TplExtensions.FollowCancelableTaskToCompletion<T> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.
public static System.Threading.Tasks.Task<T> FollowCancelableTaskToCompletion<T> (Func<System.Threading.Tasks.Task<T>> taskToFollow, System.Threading.CancellationToken ultimateCancellation, System.Threading.Tasks.TaskCompletionSource<T> taskThatFollows = default);
public static System.Threading.Tasks.Task<T> FollowCancelableTaskToCompletion<T> (Func<System.Threading.Tasks.Task<T>> taskToFollow, System.Threading.CancellationToken ultimateCancellation, System.Threading.Tasks.TaskCompletionSource<T>? taskThatFollows = default);
static member FollowCancelableTaskToCompletion : Func<System.Threading.Tasks.Task<'T>> * System.Threading.CancellationToken * System.Threading.Tasks.TaskCompletionSource<'T> -> System.Threading.Tasks.Task<'T>
Public Function FollowCancelableTaskToCompletion(Of T) (taskToFollow As Func(Of Task(Of T)), ultimateCancellation As CancellationToken, Optional taskThatFollows As TaskCompletionSource(Of T) = Nothing) As Task(Of T)
Type Parameters
- T
The type of value returned by the task.
Parameters
- ultimateCancellation
- CancellationToken
A token whose cancellation signals that the following task should be cancelled.
- taskThatFollows
- TaskCompletionSource<T>
The TaskCompletionSource whose task is to follow. Leave at null
for a new task to be created.
Returns
The following task.