A cancellation request for asynchronous or blocking synchronous operations.
It is passed to the entity creating an operation, which will usually monitor
it either by polling or by adding event handlers, and cancel the operation
if it is triggered.
For synchronous operations, this usually means either throwing a
TCancelledException or immediately returning, depending on whether
cancellation is an expected part of the task outcome or not. For
asynchronous operations, cancellation typically entails stopping background
work and cancelling a result future, if not already completed.
An operation accepting a TCancellation does not need to guarantee that it
will actually be able to react to the cancellation request.
A cancellation request for asynchronous or blocking synchronous operations.
It is passed to the entity creating an operation, which will usually monitor it either by polling or by adding event handlers, and cancel the operation if it is triggered.
For synchronous operations, this usually means either throwing a TCancelledException or immediately returning, depending on whether cancellation is an expected part of the task outcome or not. For asynchronous operations, cancellation typically entails stopping background work and cancelling a result future, if not already completed.
An operation accepting a TCancellation does not need to guarantee that it will actually be able to react to the cancellation request.