You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Inspired by conversations with Temporal 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).
The text was updated successfully, but these errors were encountered:
Inspired by conversations with Temporal 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 thewhile
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 currentAuction.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).
The text was updated successfully, but these errors were encountered: