-
Notifications
You must be signed in to change notification settings - Fork 92
Labels
enhancementNew feature or requestNew feature or request
Description
Describe the solution you'd like
We would like to expose cancellation types for Nexus operations to give users control over what happens to their Nexus operations when the parent context is cancelled. This behavior should follow the pattern set by child workflows. There should be 4 new cancellation types where are specified as part of the input options when starting an operation.
ABANDON
-> Do not send a RequestCancelNexusOperation commandTRY_CANCEL
-> Send a RequestCancelNexusOperation command and immediately report cancellation to the caller without waiting for confirmation that the operation was cancelled.WAIT_REQUESTED
-> Request cancellation of the operation and wait for confirmation that the cancel request was received by the operation handler.WAIT_COMPLETED
-> Request cancellation of the operation and wait for the operation to complete. It may or may not complete as cancelled. This is the current behavior and therefore should be the default for backwards compatibility.
To support WAIT_REQUESTED
, two new history events were added in temporalio/api#564 for NexusOperationCancelRequestCompleted
and NexusOperationCancelRequestFailed
. When either of these events are seen, that means that the cancel request was successfully delivered to the operation handler and futures for operations started with WAIT_REQUESTED
can be unblocked.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request