Click or drag to resize
DelayedTaskWhenAny Method (Task)
Creates a task that will complete when any of the supplied tasks have completed.

Namespace: Rackspace.Threading
Assembly: Rackspace.Threading (in Rackspace.Threading.dll) Version: 2.1.0-beta1
Syntax
public static Task<Task> WhenAny(
	params Task[] tasks
)

Parameters

tasks
Type: System.Threading.TasksTask
The tasks to wait on for completion.

Return Value

Type: TaskTask
A task that represents the completion of one of the supplied tasks. The return task's Result is the task that completed.
Exceptions
ExceptionCondition
ArgumentNullException

If tasks is .

ArgumentException

If tasks contains any values.

-or-

If tasks was empty.

Remarks

The returned task will complete when any of the supplied tasks has completed. The returned task will always end in the RanToCompletion state with its Result set to the first task to complete. This is true even if the first task to complete ended in the Canceled or Faulted state.

Version Information

.NET for Windows Store apps

Supported in: Windows 8

.NET Framework

Supported in: 4.5, 4.0, 3.5

Portable Class Library

Supported in: Portable Class Library (Legacy), Portable Class Library

Threading Library

Supported in: 2.1, 2.0, 1.1
See Also