TplExtensions::FollowCancelableTaskToCompletion<T> Method (Func<Task<T>^>^, CancellationToken, TaskCompletionSource<T>^)
Visual Studio 2015
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.
Assembly: Microsoft.VisualStudio.Threading (in Microsoft.VisualStudio.Threading.dll)
public: generic<typename T> static Task<T>^ FollowCancelableTaskToCompletion( Func<Task<T>^>^ taskToFollow, CancellationToken ultimateCancellation, TaskCompletionSource<T>^ taskThatFollows = null )
Parameters
- taskToFollow
-
Type:
System::Func<Task<T>^>^
The task whose result should be returned by the following task.
- ultimateCancellation
-
Type:
System.Threading::CancellationToken
A token whose cancellation signals that the following task should be cancelled.
- taskThatFollows
-
Type:
System.Threading.Tasks::TaskCompletionSource<T>^
The TaskCompletionSource whose task is to follow. Leave as null for a new task to be created.
Type Parameters
- T
The type of value returned by the task.
Show: