generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add retry metadata to fsm decl (#1554)
Changes: - Extract retries metadata declared for a FSM. The idea is that this will be the default retry policy for each transition, but that is out of scope for this PR. - Traversing the ast graph now provides a stack of nodes rather than just the current node (so we can derive info based on parent nodes, rather than maintaining that state with special cases) - removed `currentVerb` from `parserContext` as this special case is no longer needed Add retries to a FSM like this: ```go // The payment FSM. // //ftl:retry 10 5s 10m var paymentFSM = ftl.FSM("payment", ftl.Start(Created), ftl.Start(Paid), ftl.Transition(Created, Paid), ftl.Transition(Created, Failed), ftl.Transition(Paid, Completed), ) ``` In the schema it looks like this: ``` fsm payment +retry 10 5s 10m { start fsm.created start fsm.paid transition fsm.created to fsm.paid transition fsm.created to fsm.failed transition fsm.paid to fsm.completed }
- Loading branch information
Showing
9 changed files
with
718 additions
and
820 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.