Actyx / Actyx/machines

linear API for workflows

Đang mở
#47 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
8
Fork
2
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Inspired by conversations with [Temporal](https://typescript.temporal.io/api/namespaces/workflow) we could investigate using `async function*` for writing machines. One idea is to await events and yield new states. Or yielding a new state (which suspends the generator until new events arrive) returns the next batch of events.

In the auction example, yielding the Auction state would resume with either a Bid or Selected event, so writing the state progression would be done using a `while` loop. In contrast to Rust the `while` condition cannot bind a new variable, so this would be less compact, but it could still make the workflow structure nicer to read than with the current `Auction.react(...)` API.

A completely different approach would be to offer an API for non-UI code, i.e. including also the decision-making business logic in the generator; one open question here is how to ensure that commands are only performed when the local log has been consumed in full (i.e. forcing inclusion of events coming in from other peers).

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.