-
Notifications
You must be signed in to change notification settings - Fork 911
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
Conversation
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.
) (*historyservice.PollWorkflowExecutionUpdateResponse, error) { | ||
updateRef := req.GetRequest().GetUpdateRef() | ||
wfexec := updateRef.GetWorkflowExecution() | ||
upd, ok, err := func() (*update.Update, bool, error) { |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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.
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