Class TaskExtensions
public static class TaskExtensions
- Inheritance
-
objectTaskExtensions
Methods
WaitAsync(Task, CancellationToken)
Gets a System.Threading.Tasks.Task that will complete when task
completes or when the specified cancellationToken
has cancellation requested.
public static Task WaitAsync(this Task task, CancellationToken cancellationToken)
Parameters
task
TaskcancellationToken
CancellationToken
Returns
- Task
Exceptions
- OperationCanceledException
Cancellation has been requested.
WaitAsync<T>(Task<T>, CancellationToken)
Gets a System.Threading.Tasks.Task that will complete when task
completes or when the specified cancellationToken
has cancellation requested.
public static Task<T> WaitAsync<T>(this Task<T> task, CancellationToken cancellationToken)
Parameters
task
Task<T>cancellationToken
CancellationToken
Returns
- Task<T>
Type Parameters
T
Exceptions
- OperationCanceledException
Cancellation has been requested.