Table of Contents

Method WhenAny

Namespace
Anvil.API
Assembly
NWN.Anvil.dll

WhenAny(params Task[])

Waits until any of the specified tasks have completed.
NOTE: This will not cancel other tasks that have not finished running. Specify a common CancellationToken in each of the source tasks.

public static Task WhenAny(params Task[] tasks)

Parameters

tasks Task[]

The tasks to wait on for completion.

Returns

Task

WhenAny(IEnumerable<Task>)

Waits until any of the specified tasks have completed.
NOTE: This will not cancel other tasks that have not finished running. Specify a common CancellationToken in each of the source tasks.

public static Task WhenAny(IEnumerable<Task> tasks)

Parameters

tasks IEnumerable<Task>

The tasks to wait on for completion.

Returns

Task

WhenAny<TResult>(params Task<TResult>[])

Waits until any of the specified tasks have completed.
NOTE: This will not cancel other tasks that have not finished running. Specify a common CancellationToken in each of the source tasks.

public static Task<Task<TResult>> WhenAny<TResult>(params Task<TResult>[] tasks)

Parameters

tasks Task<TResult>[]

The tasks to wait on for completion.

Returns

Task<Task<TResult>>

Type Parameters

TResult

WhenAny<TResult>(IEnumerable<Task<TResult>>)

Waits until any of the specified tasks have completed.
NOTE: This will not cancel other tasks that have not finished running. Specify a common CancellationToken in each of the source tasks.

public static Task<Task<TResult>> WhenAny<TResult>(IEnumerable<Task<TResult>> tasks)

Parameters

tasks IEnumerable<Task<TResult>>

The tasks to wait on for completion.

Returns

Task<Task<TResult>>

Type Parameters

TResult