sdk-go
sdk-go copied to clipboard
Propgate Context Cancellations to Workflow Futures which are blocked on `Get(ctx, valuePtr)`
Is your feature request related to a problem? Please describe.
Cancellation of a Context passed to a WorkflowRun.Get(ctx, valuePtr)
cancels the blocking for the return value rather than the WorkflowRun
itself.
Describe the solution you'd like
Maxim describes the above as intended. An additional or different WorkflowCancelingGet(ctx, valuePtr)
which cancels the workflow allows for the more conventional "cancel all downstream actions because they are too slow or we already have the result we need" behavior as present in Golang web apps and other context-aware applications. In particular I can imagine a context in which the WorkflowRun
above has spun off a number of parallel activities in goroutines and are blocking on a Select. If that takes too long the context can be cancelled and all downstream activities can shut down and return nil
or another appropriate value/error.
Additional context This issue was created based on Maxim's request in this thread in the Temporal Slack.