TplExtensions Class
Extensions to the Task Parallel Library.
Assembly: Microsoft.VisualStudio.Threading (in Microsoft.VisualStudio.Threading.dll)
| Name | Description | |
|---|---|---|
![]() ![]() | AppendAction(Task, Action, TaskContinuationOptions, CancellationToken) | Schedules some action for execution at the conclusion of a task. |
![]() ![]() | ApplyResultTo<T>(Task, TaskCompletionSource<T>) | Applies one task's results to another. |
![]() ![]() | ApplyResultTo<T>(Task<T>, TaskCompletionSource<T>) | Applies one task's results to another. |
![]() ![]() | AttachToParent(Task) | Creates a task that is attached to the parent task, but produces the same result as an existing task. |
![]() ![]() | AttachToParent<T>(Task<T>) | Creates a task that is attached to the parent task, but produces the same result as an existing task. |
![]() ![]() | FollowCancelableTaskToCompletion<T>(Func<Task<T>>, CancellationToken, TaskCompletionSource<T>) | Gets a task that will eventually produce the result of another task, when that task finishes. If that task is instead canceled, its successor will be followed for its result, iteratively. |
![]() ![]() | Forget(Task) | Consumes a task and doesn't do anything with it. Useful for fire-and-forget calls to asynchronous methods within asynchronous methods. |
![]() ![]() | InvokeAsync(AsyncEventHandler, Object, EventArgs) | Invokes asynchronous event handlers, returning a task that completes when all event handlers have been invoked. Each handler is fully executed (including continuations) before the next handler in the list is invoked. |
![]() ![]() | InvokeAsync<TEventArgs>(AsyncEventHandler<TEventArgs>, Object, TEventArgs) | Invokes asynchronous event handlers, returning a task that completes when all event handlers have been invoked. Each handler is fully executed (including continuations) before the next handler in the list is invoked. |
![]() ![]() | NoThrowAwaitable(Task, Boolean) | Returns an awaitable for the specified task that will never throw, even if the source task faults or is canceled. |
![]() ![]() | ToApm(Task, AsyncCallback, Object) | Converts a TPL task to the Asynchronous Programming Model (APM) Begin-End pattern. |
![]() ![]() | ToApm<TResult>(Task<TResult>, AsyncCallback, Object) | Converts a TPL task to the Asynchronous Programming Model (APM) Begin-End pattern. |
![]() ![]() | WaitWithoutInlining(Task) | Wait on a task without possibly inlining it to the current thread. |
| Name | Description | |
|---|---|---|
![]() ![]() | CanceledTask | A task that is already canceled. |
![]() ![]() | CompletedTask | A singleton completed task. |
![]() ![]() | FalseTask | A completed task with a false result. |
![]() ![]() | TrueTask | A completed task with a true result. |
This type is thread-safe for all members.


