generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reference loop when using fsm.Next()
#2334
Comments
7 tasks
Open
Going with this: |
github-merge-queue bot
pushed a commit
that referenced
this issue
Aug 15, 2024
closes #1664 closes #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]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem:
Not sure the best way to get around this, while also being obvious from a dx point of view.
Here's some options:
Option 1: Wrap it in a function:
Positives:
Negatives:
non obvious whether retry directive goes on function or variable (no warning/error if they get it wrong)
Option 2: Allow separate var declaration and assignment
Negatives:
The text was updated successfully, but these errors were encountered: