Skip to content
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

improve automations interface #1709

Merged
merged 1 commit into from
Oct 16, 2024
Merged

improve automations interface #1709

merged 1 commit into from
Oct 16, 2024

Conversation

jgraettinger
Copy link
Member

@jgraettinger jgraettinger commented Oct 16, 2024

Description:

Improve the Executor interface to allow for side-effects which commit with the task poll outcome.

Issue #1697

Workflow steps:

(How does one use this feature, and how has it changed)

Documentation links affected:

(list any documentation links that you created, or existing ones that you've identified as needing updates, along with a brief description)

Notes for reviewers:

(anything that might help someone review this PR)


This change is Reviewable

@jgraettinger jgraettinger added the change:unplanned This change is unplanned, useful for things like docs label Oct 16, 2024
Copy link
Member

@psFried psFried left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.
@jgraettinger jgraettinger changed the title fix a connector networking bug and improve automations improve automations interface Oct 16, 2024
@jgraettinger jgraettinger merged commit 7df4ff3 into master Oct 16, 2024
4 checks passed
@jgraettinger jgraettinger deleted the johnny/more-automations branch October 16, 2024 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change:unplanned This change is unplanned, useful for things like docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants