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

Async Updates and the Poll API #4309

Merged
merged 6 commits into from
May 11, 2023
Merged

Async Updates and the Poll API #4309

merged 6 commits into from
May 11, 2023

Conversation

mmcshane
Copy link
Contributor

What changed?
Enable async updates and implement the PollWorkflowExecutionUpdate API

Why?
Features are dope

How did you test it?
New unit tests here, async update feature test in the features repo (not in main yet - waiting for this PR to land)

Potential risks
low but I will add a feature flag around async update requests in a subsequent PR

Is hotfix candidate?
No

@mmcshane mmcshane requested a review from a team as a code owner May 10, 2023 20:42
@mmcshane mmcshane changed the title Fully implement the PollUpdate api Async Updates and the Poll API May 10, 2023
@mmcshane mmcshane enabled auto-merge (squash) May 11, 2023 18:33
Matt McShane added 6 commits May 11, 2023 14:38
Look up the referenced update and wait on its outcome.
Can't control when WaitOutcome is called and it may reasonably be called
at a point in time when the workflow context lock is not held so rather
than loading the outcome lazily, do it when the Update object is first
loaded.
@mmcshane mmcshane merged commit a6861bf into temporalio:master May 11, 2023
@mmcshane mmcshane deleted the mpm/async-update branch May 11, 2023 19:18
) (*historyservice.PollWorkflowExecutionUpdateResponse, error) {
updateRef := req.GetRequest().GetUpdateRef()
wfexec := updateRef.GetWorkflowExecution()
upd, ok, err := func() (*update.Update, bool, error) {
Copy link
Member

Choose a reason for hiding this comment

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

Why is this? To use defer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct, for defer.

@@ -39,9 +37,6 @@ import (
const libraryName = "go.temporal.io/service/history/workflow/update"

type (
// lazyOutcome adapts a func to the future.Future[*updatepb.Outcome] interface
Copy link
Member

Choose a reason for hiding this comment

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

Sorry to see this going...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We'll think of another use for it. Let lazyOutcome live on in your heart.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants