auto optional CancellationToken propagation #7931
Replies: 2 comments 1 reply
-
See: #6300 It's a more general feature, but
If the general feature doesn't come to pass, I could see this being a way to solve for |
Beta Was this translation helpful? Give feedback.
-
Also #1332, which had a similar goal but also tried to address shortcomings with the Scala approach. (Disclosure: that issue was one of mine.) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Basically, automatically propagate all cancellation tokens that are optional arguments.
Example
On every Task-returning method that accepts an optional cancellation token, if not provided explicitly, it will automatically be inserted from the current method, so it would be compiled into:
This may reduce the verbosity in projects where tokens are passed everywhere, this feature could also be made thru attributes, something like [CallerCancellationToken]
Beta Was this translation helpful? Give feedback.
All reactions