-
Notifications
You must be signed in to change notification settings - Fork 38
Nexus cancellation sample #124
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
Conversation
|
Thanks! Did quick glance and approved CI, will set aside time to do deeper review soon. |
cretz
left a comment
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.
Looks great, only a couple of minor suggestions
| svc => svc.SayHello(new IHelloService.HelloInput(name, lang)), | ||
| new NexusOperationOptions | ||
| { | ||
| CancellationType = NexusOperationCancellationType.WaitCancellationRequested, |
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.
May deserve the similar comments here (and elsewhere) similar to the Go and Java samples
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.
Added comments that follow the other samples.
| // Wait for all other operations to complete. | ||
| await Workflow.WhenAllAsync(tasks); | ||
| } | ||
| catch (Exception ex) when (TemporalException.IsCanceledException(ex)) |
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.
When is this catch triggered in a WhenAllAsync situation for this sample? I think it makes more sense to loop over the tasks waiting for their results individually.
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.
Yea that worked out much better.
cretz
left a comment
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.
Looks great, thanks!
What was changed
Adds a NexusCancellation sample for the dotnet samples project
Why?
NexusCancellation was requested similar to Go and Java samples
Checklist
Closes Sample request: Nexus cancellation #106
How was this tested:
Manually and Unit Tests.
Similar to the Go/Java samples the caller uses
WaitCancellationRequestedCancellationType.Any docs updates needed?
Updated README with reference to NexusCancellation sample and added README to the sample.