Skip to content

Conversation

@danteesdale
Copy link
Contributor

@danteesdale danteesdale commented Jan 31, 2026

What was changed

Adds a NexusCancellation sample for the dotnet samples project

Why?

NexusCancellation was requested similar to Go and Java samples

Checklist

  1. Closes Sample request: Nexus cancellation #106

  2. How was this tested:
    Manually and Unit Tests.
    Similar to the Go/Java samples the caller uses WaitCancellationRequested CancellationType.

  3. Any docs updates needed?
    Updated README with reference to NexusCancellation sample and added README to the sample.

@danteesdale danteesdale requested a review from a team as a code owner January 31, 2026 17:15
@CLAassistant
Copy link

CLAassistant commented Jan 31, 2026

CLA assistant check
All committers have signed the CLA.

@cretz
Copy link
Member

cretz commented Feb 2, 2026

Thanks! Did quick glance and approved CI, will set aside time to do deeper review soon.

Copy link
Member

@cretz cretz left a 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,
Copy link
Member

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

Copy link
Contributor Author

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))
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

@cretz cretz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!

@cretz cretz merged commit 03acec2 into temporalio:main Feb 4, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sample request: Nexus cancellation

3 participants