System.Threading.Tasks.TaskFactory.ContinueWhenAny Method

Creates a continuation System.Threading.Tasks.Task that will be started upon the completion of any Task in the provided set.

Syntax

public Task ContinueWhenAny (Task[] tasks, Action<Task> continuationAction, TaskContinuationOptions continuationOptions)

Parameters

tasks
The array of tasks from which to continue when one task completes.
continuationAction
The action delegate to execute when one task in the tasks array completes.
continuationOptions
The System.Threading.Tasks.TaskContinuationOptions value that controls the behavior of the created continuation System.Threading.Tasks.Task.

Returns

The new continuation System.Threading.Tasks.Task.

Remarks

The NotOn* and OnlyOn* System.Threading.Tasks.TaskContinuationOptions, which constrain for which System.Threading.Tasks.TaskStatus states a continuation will be executed, are illegal with ContinueWhenAny.

Requirements

Namespace: System.Threading.Tasks
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 4.0.0.0