Cancellation token in exception handlers
See original GitHub issueWe would like to use delays in our exception handlers. However currently there is no easy way to abort those delays when the subscription is terminated. Adding a CancellationToken
to the delegate would fix this issue.
Issue Analytics
- State:
- Created 6 years ago
- Comments:7
Top Results From Across the Web
c# - Cancelling a Task is throwing an exception
Throwing OperationCanceledException is the idiomatic way that "the method you called was cancelled" is expressed in TPL. Don't fight against ...
Read more >Cancellation and catching exceptions • NServiceBus
CancellationToken property. However, it is generally preferred to not catch exceptions within message handlers and sagas, and instead let ...
Read more >A Deep Dive into C#'s CancellationToken | by Mitesh Shah
Listeners of the cancellation token can optionally throw this exception to verify the source of the cancellation and notify others that it has ......
Read more >Cancellation, Part 3: Detecting Cancellation
You may also notice that OperationCanceledException has a CancellationToken property. This is the token that caused the cancellation. That is, ...
Read more >CancellationToken.ThrowIfCancellationRequested Method
Exceptions. OperationCanceledException. The token has had cancellation requested. Remarks. This method provides functionality equivalent to: C#.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Discussed with @dennisdoomen. We will extend
SubscriptionInfo
with the cancellation token. That will fix the issue withHandleException
delegate. We will the issue in projector specific delegates later (or maybe we will not fix it at all there) because theDispatcher
level exception handling should be enough for most use cases.Don’t see any priority in this now.