Task.WhenAny(Of TResult) Method (IEnumerable(Of Task(Of TResult)))
Creates a task that will complete when any of the supplied tasks have completed.
Assembly: mscorlib (in mscorlib.dll)
Public Shared Function WhenAny(Of TResult) ( tasks As IEnumerable(Of Task(Of TResult)) ) As Task(Of Task(Of TResult))
Return ValueType: System.Threading.Tasks.Task(Of Task(Of ))
A task that represents the completion of one of the supplied tasks. The return task's Result is the task that completed.
The type of the completed task.
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.
Available since 8
Available since 4.5
Portable Class Library
Supported in: portable .NET platforms
Windows Phone Silverlight
Available since 8.0
Available since 8.1