-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(clusters): convert clusters to new workflow system
- Loading branch information
1 parent
80acec6
commit e4c16c9
Showing
367 changed files
with
6,839 additions
and
7,197 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Design | ||
|
||
## Hierarchy | ||
|
||
TODO |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Gotchas | ||
|
||
## Timestamps | ||
|
||
Use timestamps with care when passing them between activity inputs/outputs. Because activity inputs need to be | ||
consistent for replays, use `util::timestamp::now()` only within activities and not workflow bodies. | ||
|
||
If you need a timestamp in a workflow body, use `ctx.create_ts()` for the creation of the workflow. Using | ||
`ctx.ts()` is also inconsistent because it marks the start of the current workflow run (which is different | ||
between replays). | ||
|
||
If you need a consistent current timestamp, create a new activity that just returns `util::timestamp::now()`. | ||
This will be the current timestamp on the first execution of the activity and won't change on replay. | ||
|
||
> **When an activity's input doesn't produce the same hash as the first time it was executed (i.e. its input | ||
> changed), the entire workflow will error with "History Diverged" and will not restart.** | ||
## Randomly generated content | ||
|
||
Randomly generated content like UUIDs should be placed in activities for consistent history. |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Signals | ||
|
||
## Tagged signals | ||
|
||
Tagged signals are consumed on a first-come-first-serve basis because a single signal being consumed by more | ||
than one workflow is not a supported design pattern. To work around this, consume the signal by a workflow | ||
then publish multiple signals from that workflow. | ||
|
||
# Choosing Between Signals and Messages | ||
|
||
> **Note**: non-workflow ecosystem is API layer, standalone, operations, old workers | ||
## Signal | ||
|
||
- Sending data from the non-workflow ecosystem to the workflow ecosystem | ||
- Sending data from the workflow ecosystem to somewhere else in the workflow ecosystem | ||
|
||
## Message | ||
|
||
- Sending data from the workflow ecosystem to the non-workflow ecosystem | ||
|
||
## Both Signals and Messages | ||
|
||
Sometimes you may need to listen for a particular event in the workflow system and the non-workflow ecosystem. | ||
In this case you can publish both a signal and a message (you can derive `signal` and `message` on the same | ||
struct to make this easier). Just remember: signals can only be consumed once. | ||
|
||
Both messages and signals are meant to be payloads with a specific recipient. They are not meant to be | ||
published without an intended target (i.e. any listener can consume). |
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
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
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.