TaskFactory<TResult>.ContinueWhenAll 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.
Creates a continuation task that will be started upon the completion of a set of provided tasks.
Overloads
ContinueWhenAll(Task[], Func<Task[],TResult>, CancellationToken, TaskContinuationOptions, TaskScheduler)
- Source:
- FutureFactory.cs
- Source:
- FutureFactory.cs
- Source:
- FutureFactory.cs
Creates a continuation task that will be started upon the completion of a set of provided Tasks.
public:
System::Threading::Tasks::Task<TResult> ^ ContinueWhenAll(cli::array <System::Threading::Tasks::Task ^> ^ tasks, Func<cli::array <System::Threading::Tasks::Task ^> ^, TResult> ^ continuationFunction, System::Threading::CancellationToken cancellationToken, System::Threading::Tasks::TaskContinuationOptions continuationOptions, System::Threading::Tasks::TaskScheduler ^ scheduler);
public System.Threading.Tasks.Task<TResult> ContinueWhenAll (System.Threading.Tasks.Task[] tasks, Func<System.Threading.Tasks.Task[],TResult> continuationFunction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler);
member this.ContinueWhenAll : System.Threading.Tasks.Task[] * Func<System.Threading.Tasks.Task[], 'Result> * System.Threading.CancellationToken * System.Threading.Tasks.TaskContinuationOptions * System.Threading.Tasks.TaskScheduler -> System.Threading.Tasks.Task<'Result>
Public Function ContinueWhenAll (tasks As Task(), continuationFunction As Func(Of Task(), TResult), cancellationToken As CancellationToken, continuationOptions As TaskContinuationOptions, scheduler As TaskScheduler) As Task(Of TResult)
Parameters
- tasks
- Task[]
The array of tasks from which to continue.
The function delegate to execute asynchronously when all tasks in the tasks
array have completed.
- cancellationToken
- CancellationToken
The cancellation token that will be assigned to the new continuation task.
- continuationOptions
- TaskContinuationOptions
One of the enumeration values that controls the behavior of the created continuation task. The NotOn*
and OnlyOn*
values are not valid.
- scheduler
- TaskScheduler
The scheduler that is used to schedule the created continuation task.
Returns
The new continuation task.
Exceptions
The tasks
array is null
.
-or-
The continuationFunction
argument is null
.
-or-
The scheduler
argument is null
.
The tasks
array contains a null value or is empty.
continuationOptions
specifies an invalid value.
One of the elements in the tasks
array has been disposed.
-or-
The CancellationTokenSource that created cancellationToken
has already been disposed.
Remarks
After completion, a task is in one of these states: RanToCompletion, Faulted, or Canceled states.
See also
Applies to
ContinueWhenAll(Task[], Func<Task[],TResult>, TaskContinuationOptions)
- Source:
- FutureFactory.cs
- Source:
- FutureFactory.cs
- Source:
- FutureFactory.cs
Creates a continuation task that will be started upon the completion of a set of provided Tasks.
public:
System::Threading::Tasks::Task<TResult> ^ ContinueWhenAll(cli::array <System::Threading::Tasks::Task ^> ^ tasks, Func<cli::array <System::Threading::Tasks::Task ^> ^, TResult> ^ continuationFunction, System::Threading::Tasks::TaskContinuationOptions continuationOptions);
public System.Threading.Tasks.Task<TResult> ContinueWhenAll (System.Threading.Tasks.Task[] tasks, Func<System.Threading.Tasks.Task[],TResult> continuationFunction, System.Threading.Tasks.TaskContinuationOptions continuationOptions);
member this.ContinueWhenAll : System.Threading.Tasks.Task[] * Func<System.Threading.Tasks.Task[], 'Result> * System.Threading.Tasks.TaskContinuationOptions -> System.Threading.Tasks.Task<'Result>
Public Function ContinueWhenAll (tasks As Task(), continuationFunction As Func(Of Task(), TResult), continuationOptions As TaskContinuationOptions) As Task(Of TResult)
Parameters
- tasks
- Task[]
The array of tasks from which to continue.
The function delegate to execute asynchronously when all tasks in the tasks
array have completed.
- continuationOptions
- TaskContinuationOptions
One of the enumeration values that controls the behavior of the created continuation task. The NotOn*
and OnlyOn*
values are not valid.
Returns
The new continuation task.
Exceptions
One of the elements in the tasks
array has been disposed.
The continuationOptions
argument specifies an invalid value.
The tasks
array contains a null value or is empty.
Remarks
After completion, a task is in one of these states: RanToCompletion, Faulted, or Canceled states.
See also
Applies to
ContinueWhenAll(Task[], Func<Task[],TResult>)
- Source:
- FutureFactory.cs
- Source:
- FutureFactory.cs
- Source:
- FutureFactory.cs
Creates a continuation task that will be started upon the completion of a set of provided tasks.
public:
System::Threading::Tasks::Task<TResult> ^ ContinueWhenAll(cli::array <System::Threading::Tasks::Task ^> ^ tasks, Func<cli::array <System::Threading::Tasks::Task ^> ^, TResult> ^ continuationFunction);
public System.Threading.Tasks.Task<TResult> ContinueWhenAll (System.Threading.Tasks.Task[] tasks, Func<System.Threading.Tasks.Task[],TResult> continuationFunction);
member this.ContinueWhenAll : System.Threading.Tasks.Task[] * Func<System.Threading.Tasks.Task[], 'Result> -> System.Threading.Tasks.Task<'Result>
Public Function ContinueWhenAll (tasks As Task(), continuationFunction As Func(Of Task(), TResult)) As Task(Of TResult)
Parameters
- tasks
- Task[]
The array of tasks from which to continue.
The function delegate to execute asynchronously when all tasks in the tasks
array have completed.
Returns
The new continuation task.
Exceptions
One of the elements in the tasks
array has been disposed.
The tasks
array contains a null value or is empty.
Remarks
After completion, a task is in one of these states: RanToCompletion, Faulted, or Canceled states.
See also
Applies to
ContinueWhenAll(Task[], Func<Task[],TResult>, CancellationToken)
- Source:
- FutureFactory.cs
- Source:
- FutureFactory.cs
- Source:
- FutureFactory.cs
Creates a continuation task that will be started upon the completion of a set of provided tasks.
public:
System::Threading::Tasks::Task<TResult> ^ ContinueWhenAll(cli::array <System::Threading::Tasks::Task ^> ^ tasks, Func<cli::array <System::Threading::Tasks::Task ^> ^, TResult> ^ continuationFunction, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task<TResult> ContinueWhenAll (System.Threading.Tasks.Task[] tasks, Func<System.Threading.Tasks.Task[],TResult> continuationFunction, System.Threading.CancellationToken cancellationToken);
member this.ContinueWhenAll : System.Threading.Tasks.Task[] * Func<System.Threading.Tasks.Task[], 'Result> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Result>
Public Function ContinueWhenAll (tasks As Task(), continuationFunction As Func(Of Task(), TResult), cancellationToken As CancellationToken) As Task(Of TResult)
Parameters
- tasks
- Task[]
The array of tasks from which to continue.
The function delegate to execute asynchronously when all tasks in the tasks
array have completed.
- cancellationToken
- CancellationToken
The cancellation token that will be assigned to the new continuation task.
Returns
The new continuation task.
Exceptions
One of the elements in the tasks
array has been disposed.
-or-
The CancellationTokenSource that created cancellationToken
has already been disposed.
The tasks
array contains a null value or is empty.
Remarks
After completion, a task is in one of these states: RanToCompletion, Faulted, or Canceled states.
See also
Applies to
ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[], Func<Task<TAntecedentResult>[],TResult>)
- Source:
- FutureFactory.cs
- Source:
- FutureFactory.cs
- Source:
- FutureFactory.cs
Creates a continuation task that will be started upon the completion of a set of provided tasks.
public:
generic <typename TAntecedentResult>
System::Threading::Tasks::Task<TResult> ^ ContinueWhenAll(cli::array <System::Threading::Tasks::Task<TAntecedentResult> ^> ^ tasks, Func<cli::array <System::Threading::Tasks::Task<TAntecedentResult> ^> ^, TResult> ^ continuationFunction);
public System.Threading.Tasks.Task<TResult> ContinueWhenAll<TAntecedentResult> (System.Threading.Tasks.Task<TAntecedentResult>[] tasks, Func<System.Threading.Tasks.Task<TAntecedentResult>[],TResult> continuationFunction);
member this.ContinueWhenAll : System.Threading.Tasks.Task<'AntecedentResult>[] * Func<System.Threading.Tasks.Task<'AntecedentResult>[], 'Result> -> System.Threading.Tasks.Task<'Result>
Public Function ContinueWhenAll(Of TAntecedentResult) (tasks As Task(Of TAntecedentResult)(), continuationFunction As Func(Of Task(Of TAntecedentResult)(), TResult)) As Task(Of TResult)
Type Parameters
- TAntecedentResult
The type of the result of the antecedent tasks
.
Parameters
- tasks
- Task<TAntecedentResult>[]
The array of tasks from which to continue.
The function delegate to execute asynchronously when all tasks in the tasks
array have completed.
Returns
The new continuation task.
Exceptions
One of the elements in the tasks
array has been disposed.
The tasks
array contains a null value or is empty.
Remarks
After completion, a task is in one of these states: RanToCompletion, Faulted, or Canceled states.
See also
Applies to
ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[], Func<Task<TAntecedentResult>[],TResult>, CancellationToken)
- Source:
- FutureFactory.cs
- Source:
- FutureFactory.cs
- Source:
- FutureFactory.cs
Creates a continuation task that will be started upon the completion of a set of provided tasks.
public:
generic <typename TAntecedentResult>
System::Threading::Tasks::Task<TResult> ^ ContinueWhenAll(cli::array <System::Threading::Tasks::Task<TAntecedentResult> ^> ^ tasks, Func<cli::array <System::Threading::Tasks::Task<TAntecedentResult> ^> ^, TResult> ^ continuationFunction, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task<TResult> ContinueWhenAll<TAntecedentResult> (System.Threading.Tasks.Task<TAntecedentResult>[] tasks, Func<System.Threading.Tasks.Task<TAntecedentResult>[],TResult> continuationFunction, System.Threading.CancellationToken cancellationToken);
member this.ContinueWhenAll : System.Threading.Tasks.Task<'AntecedentResult>[] * Func<System.Threading.Tasks.Task<'AntecedentResult>[], 'Result> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Result>
Public Function ContinueWhenAll(Of TAntecedentResult) (tasks As Task(Of TAntecedentResult)(), continuationFunction As Func(Of Task(Of TAntecedentResult)(), TResult), cancellationToken As CancellationToken) As Task(Of TResult)
Type Parameters
- TAntecedentResult
The type of the result of the antecedent tasks
.
Parameters
- tasks
- Task<TAntecedentResult>[]
The array of tasks from which to continue.
The function delegate to execute asynchronously when all tasks in the tasks
array have completed.
- cancellationToken
- CancellationToken
The cancellation token that will be assigned to the new continuation task.
Returns
The new continuation task.
Exceptions
One of the elements in the tasks
array has been disposed.
-or-
The CancellationTokenSource that created cancellationToken
has already been disposed.
The tasks
array contains a null value or is empty.
Remarks
After completion, a task is in one of these states: RanToCompletion, Faulted, or Canceled states.
See also
Applies to
ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[], Func<Task<TAntecedentResult>[],TResult>, TaskContinuationOptions)
- Source:
- FutureFactory.cs
- Source:
- FutureFactory.cs
- Source:
- FutureFactory.cs
Creates a continuation task that will be started upon the completion of a set of provided tasks.
public:
generic <typename TAntecedentResult>
System::Threading::Tasks::Task<TResult> ^ ContinueWhenAll(cli::array <System::Threading::Tasks::Task<TAntecedentResult> ^> ^ tasks, Func<cli::array <System::Threading::Tasks::Task<TAntecedentResult> ^> ^, TResult> ^ continuationFunction, System::Threading::Tasks::TaskContinuationOptions continuationOptions);
public System.Threading.Tasks.Task<TResult> ContinueWhenAll<TAntecedentResult> (System.Threading.Tasks.Task<TAntecedentResult>[] tasks, Func<System.Threading.Tasks.Task<TAntecedentResult>[],TResult> continuationFunction, System.Threading.Tasks.TaskContinuationOptions continuationOptions);
member this.ContinueWhenAll : System.Threading.Tasks.Task<'AntecedentResult>[] * Func<System.Threading.Tasks.Task<'AntecedentResult>[], 'Result> * System.Threading.Tasks.TaskContinuationOptions -> System.Threading.Tasks.Task<'Result>
Public Function ContinueWhenAll(Of TAntecedentResult) (tasks As Task(Of TAntecedentResult)(), continuationFunction As Func(Of Task(Of TAntecedentResult)(), TResult), continuationOptions As TaskContinuationOptions) As Task(Of TResult)
Type Parameters
- TAntecedentResult
The type of the result of the antecedent tasks
.
Parameters
- tasks
- Task<TAntecedentResult>[]
The array of tasks from which to continue.
The function delegate to execute asynchronously when all tasks in the tasks
array have completed.
- continuationOptions
- TaskContinuationOptions
One of the enumeration values that controls the behavior of the created continuation task. The NotOn*
and OnlyOn*
values are not valid.
Returns
The new continuation task.
Exceptions
One of the elements in the tasks
array has been disposed.
The continuationOptions
argument specifies an invalid value.
The tasks
array contains a null value or is empty.
Remarks
After completion, a task is in one of these states: RanToCompletion, Faulted, or Canceled states.
See also
Applies to
ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[], Func<Task<TAntecedentResult>[],TResult>, CancellationToken, TaskContinuationOptions, TaskScheduler)
- Source:
- FutureFactory.cs
- Source:
- FutureFactory.cs
- Source:
- FutureFactory.cs
Creates a continuation task that will be started upon the completion of a set of provided tasks.
public:
generic <typename TAntecedentResult>
System::Threading::Tasks::Task<TResult> ^ ContinueWhenAll(cli::array <System::Threading::Tasks::Task<TAntecedentResult> ^> ^ tasks, Func<cli::array <System::Threading::Tasks::Task<TAntecedentResult> ^> ^, TResult> ^ continuationFunction, System::Threading::CancellationToken cancellationToken, System::Threading::Tasks::TaskContinuationOptions continuationOptions, System::Threading::Tasks::TaskScheduler ^ scheduler);
public System.Threading.Tasks.Task<TResult> ContinueWhenAll<TAntecedentResult> (System.Threading.Tasks.Task<TAntecedentResult>[] tasks, Func<System.Threading.Tasks.Task<TAntecedentResult>[],TResult> continuationFunction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler);
member this.ContinueWhenAll : System.Threading.Tasks.Task<'AntecedentResult>[] * Func<System.Threading.Tasks.Task<'AntecedentResult>[], 'Result> * System.Threading.CancellationToken * System.Threading.Tasks.TaskContinuationOptions * System.Threading.Tasks.TaskScheduler -> System.Threading.Tasks.Task<'Result>
Public Function ContinueWhenAll(Of TAntecedentResult) (tasks As Task(Of TAntecedentResult)(), continuationFunction As Func(Of Task(Of TAntecedentResult)(), TResult), cancellationToken As CancellationToken, continuationOptions As TaskContinuationOptions, scheduler As TaskScheduler) As Task(Of TResult)
Type Parameters
- TAntecedentResult
The type of the result of the antecedent tasks
.
Parameters
- tasks
- Task<TAntecedentResult>[]
The array of tasks from which to continue.
The function delegate to execute asynchronously when all tasks in the tasks
array have completed.
- cancellationToken
- CancellationToken
The cancellation token that will be assigned to the new continuation task.
- continuationOptions
- TaskContinuationOptions
One of the enumeration values that controls the behavior of the created continuation task. The NotOn*
and OnlyOn*
values are not valid.
- scheduler
- TaskScheduler
The scheduler that is used to schedule the created continuation task.
Returns
The new continuation task.
Exceptions
The tasks
array is null
.
-or-
The continuationFunction
argument is null
.
-or-
The scheduler
argument is null
.
The tasks
array contains a null value or is empty.
The continuationOptions
argument specifies an invalid value.
One of the elements in the tasks
array has been disposed.
-or-
The CancellationTokenSource that created cancellationToken
has already been disposed.
Remarks
After completion, a task is in one of these states: RanToCompletion, Faulted, or Canceled states.
See also
Applies to
.NET