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
Currently, sending an event to an FSM while the FSM is transitioning is invalid. However, sometimes the state itself knows what the next state should be.
We could either allow Send() to be used in this fashion directly, or add a new method Next() that fulfils this need.
closes#1664closes#2334
This is particularly useful when an FSM state itself knows which state
it should be in next, for example transitioning a payment to "voided" if
an error occurs communicating with an external vendor.
- Adds `fsm.Next(ctx, event)` to the go runtime
- Only one next transition is allowed per fsm instance
- When a transition completes, the next transition is queued up if it
exists
- When a transition returns an error, we wipe the next transition so
that the retry attempt can set the next transition again
In another PR we will move away from using `ftl.Next()` to avoid the
reference cycle issue.
---------
Co-authored-by: Matt Toohey <[email protected]>
Currently, sending an event to an FSM while the FSM is transitioning is invalid. However, sometimes the state itself knows what the next state should be.
We could either allow
Send()
to be used in this fashion directly, or add a new methodNext()
that fulfils this need.fsm -> funcs -> fsm.Next()
The text was updated successfully, but these errors were encountered: