-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
automations: refine interface with separate Outcome & Action
A gap of the previous interface is that task polls will often want to make databases changes, and those changes should commit in the same transaction that updates the `internal.tasks` table with messages and state. Introduce an Outcome trait which is applied to Postgres transaction it's given, an to which its returned Action is also applied. This lets the Executor implement an optimistic concurrency workflow and further lets it defer deciding what its polling Action will be until after it verifies its optimistic lock.
- Loading branch information
1 parent
69765a6
commit 233748c
Showing
3 changed files
with
105 additions
and
85 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
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.