-
-
Notifications
You must be signed in to change notification settings - Fork 357
CancellationTokenExtensions
StephenCleary edited this page Sep 5, 2014
·
1 revision
The CancellationTokenExtensions
type provides a single extension method for CancellationToken
: AsTask
, which returns a task that will enter the Canceled
state when the CancellationToken
is signaled. If the CancellationToken
is never signaled, the returned task will never complete.
public static class CancellationTokenExtensions
{
// Returns a Task that is canceled when this CancellationToken is canceled.
public static Task AsTask(this CancellationToken cancellationToken);
}
The full API is supported on all platforms.