Add CancellationType to nexus cancellation sample#741
Add CancellationType to nexus cancellation sample#741Quinn-With-Two-Ns merged 2 commits intotemporalio:mainfrom
Conversation
prasek
left a comment
There was a problem hiding this comment.
overall lgtm and dropped a suggestion
| // scope | ||
| scope.cancel(); | ||
| // Optionally, wait for all nexus operations to complete | ||
| // Optionally, wait for all nexus operations to receive a cancellation request before |
There was a problem hiding this comment.
The docs make it sound like we should recommend waiting to ensure the cancel is delivered to the handler, if so would clarify the behavior here: if you wait/don't wait for Nexus ops to complete in caller workflow before exiting the caller workflow, then cancel will/may be delivered if using WAIT_REQUESTED
There was a problem hiding this comment.
Yeah I agree we should recommend waiting. Just to be clear the caller isn't waiting for the nexus op to complete if they are using WAIT_REQUESTED they are just waiting for the cancel to be requested . There can be a gap between when cancel is requested and when the nexus op actually completes, I simulate that in this sample by sleeping after the cancel request.
8b74b2d to
c1aaaea
Compare
Add CancellationType to nexus cancellation sample