Feature: Non-blocking signal and update handlers
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- go, yaml
- Lĩnh vực
- backend, distributed-systems
Hướng nghiên cứu
Bắt đầu bằng cách lần theo entry point listen hiện có và hành vi Continue-As-New của runtime. So sánh cú pháp YAML handlers được đề xuất với các câu hỏi thiết kế còn bỏ ngỏ, sau đó sử dụng các tiêu chí chấp nhận đã nêu và yêu cầu về độ bao phủ E2E để xác định khi nào các signal không chặn, các bản cập nhật, khả năng hiển thị state và khả năng tồn tại của handler đã hoàn tất.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Add support for non-blocking signal and update handlers.
Today, listen is intentionally blocking:
queryregisters a handler and continues executionsignalblocks until a matching signal is receivedupdateblocks until a matching update is received
This works well for approval workflows and other wait-for-event patterns, but makes it difficult to model long-running entity-style workflows that must continue executing while still accepting external messages.
Motivation
Temporal supports message handlers that can execute independently of the main workflow path.
Examples:
-
Order workflow
- Signal: cancel order
- Signal: change shipping address
- Query: current status
-
Subscription workflow
- Signal: pause subscription
- Signal: resume subscription
- Update: change plan
- Query: billing status
-
Batch processing workflow
- Signal: increase concurrency
- Signal: stop after current batch
- Update: add more work
- Query: current progress
In these scenarios, the workflow should continue running while remaining responsive to external messages.
Currently, Zigflow users must model signals and updates as explicit blocking steps in the workflow, which prevents this style of workflow.
Proposed design
Introduce a dedicated non-blocking message handler construct rather than extending the semantics of listen.
Example:
handlers:
signals:
cancel:
set:
cancelled: true
updates:
setPriority:
set:
priority: ${ .priority }
Alternative syntaxes are possible.
The important behaviour is:
- Handlers are registered when the workflow starts
- Handlers remain active for the lifetime of the workflow
- Handlers do not block workflow execution
- Handlers may modify workflow state
- Queries can observe state modified by handlers
Continue-As-New considerations
Non-blocking handlers must survive Continue-As-New.
The runtime should:
- Re-register handlers on the continued execution
- Preserve any state mutations made by handlers
- Continue routing signals and updates addressed to the Workflow ID
Open questions
- Should handlers be allowed to execute activities?
- Should handlers be allowed to mutate
$context,$data, or both? - Should handlers be able to return values directly (update-style responses)?
- What concurrency guarantees should exist when handlers and workflow execution modify the same state?
- Should handler definitions be a new top-level section (
handlers) or an extension oflisten?
Acceptance criteria
- Users can define non-blocking signal handlers
- Users can define non-blocking update handlers
- Workflow execution continues while handlers remain active
- Handler state changes are visible to queries
- Handlers survive Continue-As-New
- Documentation and examples are provided
- E2E tests cover signal, update and Continue-As-New behaviour
- Ngôn ngữ chính
- Go
- Star
- 209
- Fork
- 27
- Merge trung bình
- 6 giờ 35 phút
- Pull request đã merge (30 ngày)
- 30
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của zigflow/zigflow
-
never-stale v1
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
zigflow/zigflow#590 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Support workflow streamsĐang mởenhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement help wanted
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
zigflow/zigflow#556 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 62/100
zigflow/zigflow#543 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của zigflow/zigflow
Issue tương tự
-
area/proxy kind/bug priority/backlog triage/accepted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
lexfrei/cloudflare-tunnel-gateway-controller#840 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:chat bug sev:papercut
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Agent-Field/CodeAF#1592 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
kind/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 7 ngày
-
bug needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug P2 reliability
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
afreidah/s3-orchestrator#1564 ·
Maintainer thường phản hồi trong vòng 1 ngày