Creates a new CancellationToken
or cancels one that has already created. There is a 1:1 CancellationTokenSource
to CancellationToken
relationship.
To create a CancellationToken,
create a CancellationTokenSource first and then call getToken()
to get the CancellationToken
for this CancellationTokenSource.
|
CancellationTokenSource()
Creates a new
CancellationTokenSource
instance.
|
| void |
cancel()
Cancels the
CancellationToken
if cancellation has not been requested yet.
|
| CancellationToken |
getToken()
Gets the
CancellationToken
for this CancellationTokenSource.
|
Creates a new CancellationTokenSource
instance.
Cancels the CancellationToken
if cancellation has not been requested yet.
Gets the CancellationToken
for this CancellationTokenSource.
CancellationToken
that can be passed to asynchronous Task to cancel
the Task.