TaskFactory.ContinueWhenAny 메서드

정의

제공된 집합에서 작업이 완료될 때 시작할 연속 Task를 만듭니다.Creates a continuation Task that will be started upon the completion of any Task in the provided set.

오버로드

ContinueWhenAny(Task[], Action<Task>, TaskContinuationOptions)

제공된 집합에서 작업이 완료될 때 시작할 연속 Task를 만듭니다.Creates a continuation Task that will be started upon the completion of any Task in the provided set.

ContinueWhenAny(Task[], Action<Task>, CancellationToken, TaskContinuationOptions, TaskScheduler)

제공된 집합에서 작업이 완료될 때 시작할 연속 Task를 만듭니다.Creates a continuation Task that will be started upon the completion of any Task in the provided set.

ContinueWhenAny(Task[], Action<Task>)

제공된 집합에서 작업이 완료될 때 시작할 연속 Task를 만듭니다.Creates a continuation Task that will be started upon the completion of any Task in the provided set.

ContinueWhenAny(Task[], Action<Task>, CancellationToken)

제공된 집합에서 작업이 완료될 때 시작할 연속 Task를 만듭니다.Creates a continuation Task that will be started upon the completion of any Task in the provided set.

ContinueWhenAny<TAntecedentResult,TResult>(Task<TAntecedentResult>[], Func<Task<TAntecedentResult>,TResult>, TaskContinuationOptions)

제공된 집합에서 작업이 완료될 때 시작할 연속 Task<TResult>를 만듭니다.Creates a continuation Task<TResult> that will be started upon the completion of any Task in the provided set.

ContinueWhenAny<TAntecedentResult,TResult>(Task<TAntecedentResult>[], Func<Task<TAntecedentResult>,TResult>)

제공된 집합에서 작업이 완료될 때 시작할 연속 Task<TResult>를 만듭니다.Creates a continuation Task<TResult> that will be started upon the completion of any Task in the provided set.

ContinueWhenAny<TAntecedentResult,TResult>(Task<TAntecedentResult>[], Func<Task<TAntecedentResult>,TResult>, CancellationToken)

제공된 집합에서 작업이 완료될 때 시작할 연속 Task<TResult>를 만듭니다.Creates a continuation Task<TResult> that will be started upon the completion of any Task in the provided set.

ContinueWhenAny<TAntecedentResult,TResult>(Task<TAntecedentResult>[], Func<Task<TAntecedentResult>,TResult>, CancellationToken, TaskContinuationOptions, TaskScheduler)

제공된 집합에서 작업이 완료될 때 시작할 연속 Task<TResult>를 만듭니다.Creates a continuation Task<TResult> that will be started upon the completion of any Task in the provided set.

ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[], Action<Task<TAntecedentResult>>)

제공된 집합에서 작업이 완료될 때 시작할 연속 Task를 만듭니다.Creates a continuation Task that will be started upon the completion of any Task in the provided set.

ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[], Action<Task<TAntecedentResult>>, CancellationToken)

제공된 집합에서 작업이 완료될 때 시작할 연속 Task를 만듭니다.Creates a continuation Task that will be started upon the completion of any Task in the provided set.

ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[], Action<Task<TAntecedentResult>>, TaskContinuationOptions)

제공된 집합에서 작업이 완료될 때 시작할 연속 Task를 만듭니다.Creates a continuation Task that will be started upon the completion of any Task in the provided set.

ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[], Action<Task<TAntecedentResult>>, CancellationToken, TaskContinuationOptions, TaskScheduler)

제공된 집합에서 작업이 완료될 때 시작할 연속 Task를 만듭니다.Creates a continuation Task that will be started upon the completion of any Task in the provided set.

ContinueWhenAny<TResult>(Task[], Func<Task,TResult>)

제공된 집합에서 작업이 완료될 때 시작할 연속 Task<TResult>를 만듭니다.Creates a continuation Task<TResult> that will be started upon the completion of any Task in the provided set.

ContinueWhenAny<TResult>(Task[], Func<Task,TResult>, CancellationToken)

제공된 집합에서 작업이 완료될 때 시작할 연속 Task<TResult>를 만듭니다.Creates a continuation Task<TResult> that will be started upon the completion of any Task in the provided set.

ContinueWhenAny<TResult>(Task[], Func<Task,TResult>, TaskContinuationOptions)

제공된 집합에서 작업이 완료될 때 시작할 연속 Task<TResult>를 만듭니다.Creates a continuation Task<TResult> that will be started upon the completion of any Task in the provided set.

ContinueWhenAny<TResult>(Task[], Func<Task,TResult>, CancellationToken, TaskContinuationOptions, TaskScheduler)

제공된 집합에서 작업이 완료될 때 시작할 연속 Task<TResult>를 만듭니다.Creates a continuation Task<TResult> that will be started upon the completion of any Task in the provided set.

ContinueWhenAny(Task[], Action<Task>, TaskContinuationOptions)

제공된 집합에서 작업이 완료될 때 시작할 연속 Task를 만듭니다.Creates a continuation Task that will be started upon the completion of any Task in the provided set.

public:
 System::Threading::Tasks::Task ^ ContinueWhenAny(cli::array <System::Threading::Tasks::Task ^> ^ tasks, Action<System::Threading::Tasks::Task ^> ^ continuationAction, System::Threading::Tasks::TaskContinuationOptions continuationOptions);
public System.Threading.Tasks.Task ContinueWhenAny (System.Threading.Tasks.Task[] tasks, Action<System.Threading.Tasks.Task> continuationAction, System.Threading.Tasks.TaskContinuationOptions continuationOptions);
member this.ContinueWhenAny : System.Threading.Tasks.Task[] * Action<System.Threading.Tasks.Task> * System.Threading.Tasks.TaskContinuationOptions -> System.Threading.Tasks.Task
Public Function ContinueWhenAny (tasks As Task(), continuationAction As Action(Of Task), continuationOptions As TaskContinuationOptions) As Task

매개 변수

tasks
Task[]

작업이 완료될 때 계속할 작업의 배열입니다.The array of tasks from which to continue when one task completes.

continuationAction
Action<Task>

tasks 배열에서 작업이 완료될 때 실행할 동작 대리자입니다.The action delegate to execute when one task in the tasks array completes.

continuationOptions
TaskContinuationOptions

만들어진 연속 TaskContinuationOptions의 동작을 제어하는 Task 값입니다.The TaskContinuationOptions value that controls the behavior of the created continuation Task.

반환

새 연속 Task입니다.The new continuation Task.

예외

tasks 배열에 있는 요소 중 하나가 삭제되었습니다.One of the elements in the tasks array has been disposed.

tasks 배열이 null인 경우The tasks array is null.

또는-or- continuationActionnull인 경우continuationAction is null.

continuationOptions는 잘못된 TaskContinuationOptions 값을 지정합니다.continuationOptions specifies an invalid TaskContinuationOptions value.

tasks 배열에 null 값이 포함된 경우The tasks array contains a null value.

또는-or- tasks 배열이 비어 있는 경우The tasks array is empty.

설명

연속 작업이 실행 될 TaskStatus 상태를 제한 하는 NotOn @ no__t-0 및 전용 @ no__t-1 TaskContinuationOptionsContinueWhenAny에서 사용할 수 없습니다.The NotOn* and OnlyOn* TaskContinuationOptions, which constrain for which TaskStatus states a continuation will be executed, are illegal with ContinueWhenAny.

추가 정보

ContinueWhenAny(Task[], Action<Task>, CancellationToken, TaskContinuationOptions, TaskScheduler)

제공된 집합에서 작업이 완료될 때 시작할 연속 Task를 만듭니다.Creates a continuation Task that will be started upon the completion of any Task in the provided set.

public:
 System::Threading::Tasks::Task ^ ContinueWhenAny(cli::array <System::Threading::Tasks::Task ^> ^ tasks, Action<System::Threading::Tasks::Task ^> ^ continuationAction, System::Threading::CancellationToken cancellationToken, System::Threading::Tasks::TaskContinuationOptions continuationOptions, System::Threading::Tasks::TaskScheduler ^ scheduler);
public System.Threading.Tasks.Task ContinueWhenAny (System.Threading.Tasks.Task[] tasks, Action<System.Threading.Tasks.Task> continuationAction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler);
member this.ContinueWhenAny : System.Threading.Tasks.Task[] * Action<System.Threading.Tasks.Task> * System.Threading.CancellationToken * System.Threading.Tasks.TaskContinuationOptions * System.Threading.Tasks.TaskScheduler -> System.Threading.Tasks.Task

매개 변수

tasks
Task[]

작업이 완료될 때 계속할 작업의 배열입니다.The array of tasks from which to continue when one task completes.

continuationAction
Action<Task>

tasks 배열에서 작업이 완료될 때 실행할 동작 대리자입니다.The action delegate to execute when one task in the tasks array completes.

cancellationToken
CancellationToken

새 연속 작업에 할당할 CancellationToken입니다.The CancellationToken that will be assigned to the new continuation task.

continuationOptions
TaskContinuationOptions

만들어진 연속 TaskContinuationOptions의 동작을 제어하는 Task 값입니다.The TaskContinuationOptions value that controls the behavior of the created continuation Task.

scheduler
TaskScheduler

만들어진 연속 TaskScheduler를 예약하는 데 사용할 Task입니다.The TaskScheduler that is used to schedule the created continuation Task.

반환

새 연속 Task입니다.The new continuation Task.

예외

tasks 배열이 null인 경우The tasks array is null.

또는-or- continuationActionnull인 경우continuationAction is null.

또는-or- schedulernull인 경우scheduler is null.

tasks 배열에 null 값이 포함된 경우The tasks array contains a null value.

또는-or- tasks 배열이 비어 있는 경우The tasks array is empty.

continuationOptions는 잘못된 TaskContinuationOptions 값을 지정합니다.continuationOptions specifies an invalid TaskContinuationOptions value.

제공된 CancellationToken가 이미 삭제된 경우The provided CancellationToken has already been disposed.

설명

연속 작업이 실행 될 TaskStatus 상태를 제한 하는 NotOn @ no__t-0 및 전용 @ no__t-1 TaskContinuationOptionsContinueWhenAny에서 사용할 수 없습니다.The NotOn* and OnlyOn* TaskContinuationOptions, which constrain for which TaskStatus states a continuation will be executed, are illegal with ContinueWhenAny.

추가 정보

ContinueWhenAny(Task[], Action<Task>)

제공된 집합에서 작업이 완료될 때 시작할 연속 Task를 만듭니다.Creates a continuation Task that will be started upon the completion of any Task in the provided set.

public:
 System::Threading::Tasks::Task ^ ContinueWhenAny(cli::array <System::Threading::Tasks::Task ^> ^ tasks, Action<System::Threading::Tasks::Task ^> ^ continuationAction);
public System.Threading.Tasks.Task ContinueWhenAny (System.Threading.Tasks.Task[] tasks, Action<System.Threading.Tasks.Task> continuationAction);
member this.ContinueWhenAny : System.Threading.Tasks.Task[] * Action<System.Threading.Tasks.Task> -> System.Threading.Tasks.Task
Public Function ContinueWhenAny (tasks As Task(), continuationAction As Action(Of Task)) As Task

매개 변수

tasks
Task[]

작업이 완료될 때 계속할 작업의 배열입니다.The array of tasks from which to continue when one task completes.

continuationAction
Action<Task>

tasks 배열에서 작업이 완료될 때 실행할 동작 대리자입니다.The action delegate to execute when one task in the tasks array completes.

반환

새 연속 Task입니다.The new continuation Task.

예외

tasks 배열에 있는 요소 중 하나가 삭제되었습니다.One of the elements in the tasks array has been disposed.

tasks 배열이 null인 경우The tasks array is null.

또는-or- continuationAction 인수가 null인 경우The continuationAction argument is null.

tasks 배열에 null 값이 포함된 경우The tasks array contains a null value.

또는-or- tasks 배열이 비어 있는 경우The tasks array is empty.

예제

다음 예제에서는 사용 하는 방법을 보여 줍니다 ContinueWhenAnyContinueWhenAll:The following example shows how to use ContinueWhenAny and ContinueWhenAll:

using System;
using System.Threading;
using System.Threading.Tasks;

class ContinueWhenMultiDemo
{
    // Demonstrated features:
    // 		Task.Factory
    //		TaskFactory.ContinueWhenAll()
    //		TaskFactory.ContinueWhenAny()
    //		Task.Wait()
    // Expected results:
    // 		Three tasks are created in parallel. 
    //		Each task for a different period of time prints a number and returns it.
    //      A ContinueWhenAny() task indicates the first of the three tasks to complete.
    //      A ContinueWhenAll() task sums up the results of the three tasks and prints out the total.
    // Documentation:
    //		http://msdn.microsoft.com/library/system.threading.tasks.taskfactory_members(VS.100).aspx
    static void Main()
    {
        // Schedule a list of tasks that return integer
        Task<int>[] tasks = new Task<int>[]
            {
                Task<int>.Factory.StartNew(() => 
                    {
                        Thread.Sleep(500);
                        Console.WriteLine("Task={0}, Thread={1}, x=5", Task.CurrentId, Thread.CurrentThread.ManagedThreadId);
                        return 5;
                    }),

                Task<int>.Factory.StartNew(() => 
                    {
                        Thread.Sleep(10);
                        Console.WriteLine("Task={0}, Thread={1}, x=3", Task.CurrentId, Thread.CurrentThread.ManagedThreadId);
                        return 3;
                    }),

                Task<int>.Factory.StartNew(() => 
                    {
                        Thread.Sleep(200);
                        Console.WriteLine("Task={0}, Thread={1}, x=2", Task.CurrentId, Thread.CurrentThread.ManagedThreadId);
                        return 2;
                    })
            };

        // Schedule a continuation to indicate the result of the first task to complete
        Task.Factory.ContinueWhenAny(tasks, winner =>
        {
            // You would expect winning result = 3 on multi-core systems, because you expect
            // tasks[1] to finish first.
            Console.WriteLine("Task={0}, Thread={1} (ContinueWhenAny): Winning result = {2}", Task.CurrentId, Thread.CurrentThread.ManagedThreadId, winner.Result);
        });


        // Schedule a continuation that sums up the results of all tasks, then wait on it.
        // The list of antecendent tasks is passed as an argument by the runtime.
        Task.Factory.ContinueWhenAll(tasks,
            (antecendents) =>
            {
                int sum = 0;
                foreach (Task<int> task in antecendents)
                {
                    sum += task.Result;
                }

                Console.WriteLine("Task={0}, Thread={1}, (ContinueWhenAll): Total={2} (expected 10)", Task.CurrentId, Thread.CurrentThread.ManagedThreadId, sum);
            })
            .Wait();
    }
}
Imports System.Threading
Imports System.Threading.Tasks

Module ContinuationWhenMulti
    ' Demonstrated features:
    '   Task.Factory
    '   TaskFactory.ContinueWhenAll()
    '   TaskFactory.ContinueWhenAny()
    '   Task.Wait()
    ' Expected results:
    '   Three tasks are created in parallel. 
    '   Each task for a different period of time prints a number and returns it.
    '   A ContinueWhenAny() task indicates the first of the three tasks to complete.
    '   A ContinueWhenAll() task sums up the results of the three tasks and prints out the total.
    ' Documentation:
    '   http://msdn.microsoft.com/library/system.threading.tasks.taskfactory_members(VS.100).aspx
    Sub Main()
        ' Schedule a list of tasks that return integer
        Dim tasks As Task(Of Integer)() = New Task(Of Integer)() {
            Task(Of Integer).Factory.StartNew(Function()
                                                  Thread.Sleep(500)
                                                  Console.WriteLine("Task={0}, Thread={1}, x=5", Task.CurrentId, Thread.CurrentThread.ManagedThreadId)
                                                  Return 5
                                              End Function),
            Task(Of Integer).Factory.StartNew(Function()
                                                  Thread.Sleep(10)
                                                  Console.WriteLine("Task={0}, Thread={1}, x=3", Task.CurrentId, Thread.CurrentThread.ManagedThreadId)
                                                  Return 3
                                              End Function),
            Task(Of Integer).Factory.StartNew(Function()
                                                  Thread.Sleep(200)
                                                  Console.WriteLine("Task={0}, Thread={1}, x=2", Task.CurrentId, Thread.CurrentThread.ManagedThreadId)
                                                  Return 2
                                              End Function)}


        ' Schedule a continuation to indicate the result of the first task to complete
        Task.Factory.ContinueWhenAny(tasks, Sub(winner)
                                                ' You would expect winning result = 3 on multi-core systems, because you expect
                                                ' tasks[1] to finish first.
                                                Console.WriteLine("Task={0}, Thread={1} (ContinueWhenAny): Winning result = {2}", Task.CurrentId, Thread.CurrentThread.ManagedThreadId, winner.Result)
                                            End Sub)


        ' Schedule a continuation that sums up the results of all tasks, then wait on it.
        ' The list of antecendent tasks is passed as an argument by the runtime.
        Task.Factory.ContinueWhenAll(tasks, Sub(antecendents)
                                                Dim sum As Integer = 0
                                                For Each task__1 As Task(Of Integer) In antecendents
                                                    sum += task__1.Result
                                                Next
                                                Console.WriteLine("Task={0}, Thread={1}, (ContinueWhenAll): Total={2} (expected 10)", Task.CurrentId, Thread.CurrentThread.ManagedThreadId, sum)
                                            End Sub).Wait()
    End Sub
End Module

추가 정보

ContinueWhenAny(Task[], Action<Task>, CancellationToken)

제공된 집합에서 작업이 완료될 때 시작할 연속 Task를 만듭니다.Creates a continuation Task that will be started upon the completion of any Task in the provided set.

public:
 System::Threading::Tasks::Task ^ ContinueWhenAny(cli::array <System::Threading::Tasks::Task ^> ^ tasks, Action<System::Threading::Tasks::Task ^> ^ continuationAction, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task ContinueWhenAny (System.Threading.Tasks.Task[] tasks, Action<System.Threading.Tasks.Task> continuationAction, System.Threading.CancellationToken cancellationToken);
member this.ContinueWhenAny : System.Threading.Tasks.Task[] * Action<System.Threading.Tasks.Task> * System.Threading.CancellationToken -> System.Threading.Tasks.Task

매개 변수

tasks
Task[]

작업이 완료될 때 계속할 작업의 배열입니다.The array of tasks from which to continue when one task completes.

continuationAction
Action<Task>

tasks 배열에서 작업이 완료될 때 실행할 동작 대리자입니다.The action delegate to execute when one task in the tasks array completes.

cancellationToken
CancellationToken

새 연속 작업에 할당할 CancellationToken입니다.The CancellationToken that will be assigned to the new continuation task.

반환

새 연속 Task입니다.The new continuation Task.

예외

tasks 배열에 있는 요소 중 하나가 삭제되었습니다.One of the elements in the tasks array has been disposed.

또는-or- cancellationToken가 이미 삭제되었습니다.cancellationToken has already been disposed.

tasks 배열이 null인 경우The tasks array is null.

또는-or- continuationAction 인수가 null인 경우The continuationAction argument is null.

tasks 배열에 null 값이 포함된 경우The tasks array contains a null value.

또는-or- tasks 배열이 비어 있습니다.The tasks array is empty .

추가 정보

ContinueWhenAny<TAntecedentResult,TResult>(Task<TAntecedentResult>[], Func<Task<TAntecedentResult>,TResult>, TaskContinuationOptions)

제공된 집합에서 작업이 완료될 때 시작할 연속 Task<TResult>를 만듭니다.Creates a continuation Task<TResult> that will be started upon the completion of any Task in the provided set.

public:
generic <typename TAntecedentResult, typename TResult>
 System::Threading::Tasks::Task<TResult> ^ ContinueWhenAny(cli::array <System::Threading::Tasks::Task<TAntecedentResult> ^> ^ tasks, Func<System::Threading::Tasks::Task<TAntecedentResult> ^, TResult> ^ continuationFunction, System::Threading::Tasks::TaskContinuationOptions continuationOptions);
public System.Threading.Tasks.Task<TResult> ContinueWhenAny<TAntecedentResult,TResult> (System.Threading.Tasks.Task<TAntecedentResult>[] tasks, Func<System.Threading.Tasks.Task<TAntecedentResult>,TResult> continuationFunction, System.Threading.Tasks.TaskContinuationOptions continuationOptions);
member this.ContinueWhenAny : System.Threading.Tasks.Task<'AntecedentResult>[] * Func<System.Threading.Tasks.Task<'AntecedentResult>, 'Result> * System.Threading.Tasks.TaskContinuationOptions -> System.Threading.Tasks.Task<'Result>
Public Function ContinueWhenAny(Of TAntecedentResult, TResult) (tasks As Task(Of TAntecedentResult)(), continuationFunction As Func(Of Task(Of TAntecedentResult), TResult), continuationOptions As TaskContinuationOptions) As Task(Of TResult)

형식 매개 변수

TAntecedentResult

선행 tasks의 결과 형식입니다.The type of the result of the antecedent tasks.

TResult

continuationFunction 대리자가 반환하고 만들어진 Task<TResult>와 연결되는 결과의 형식입니다.The type of the result that is returned by the continuationFunction delegate and associated with the created Task<TResult>.

매개 변수

tasks
Task<TAntecedentResult>[]

작업이 완료될 때 계속할 작업의 배열입니다.The array of tasks from which to continue when one task completes.

continuationFunction
Func<Task<TAntecedentResult>,TResult>

tasks 배열에서 작업이 완료될 때 비동기로 실행할 함수 대리자입니다.The function delegate to execute asynchronously when one task in the tasks array completes.

continuationOptions
TaskContinuationOptions

만들어진 연속 TaskContinuationOptions의 동작을 제어하는 Task<TResult> 값입니다.The TaskContinuationOptions value that controls the behavior of the created continuation Task<TResult>.

반환

새 연속 Task<TResult>입니다.The new continuation Task<TResult>.

예외

tasks 배열에 있는 요소 중 하나가 삭제되었습니다.One of the elements in the tasks array has been disposed.

tasks 배열이 null인 경우The tasks array is null.

또는-or- continuationFunctionnull인 경우continuationFunction is null.

continuationOptions는 잘못된 TaskContinuationOptions 값을 지정합니다.continuationOptions specifies an invalid TaskContinuationOptions value.

tasks 배열에 null 값이 들어 있습니다.The tasks array contains a null value.

또는-or- tasks 배열이 비어 있는 경우The tasks array is empty.

설명

연속 작업이 실행 될 TaskStatus 상태를 제한 하는 NotOn @ no__t-0 및 전용 @ no__t-1 TaskContinuationOptionsContinueWhenAny에서 사용할 수 없습니다.The NotOn* and OnlyOn* TaskContinuationOptions, which constrain for which TaskStatus states a continuation will be executed, are illegal with ContinueWhenAny.

추가 정보

ContinueWhenAny<TAntecedentResult,TResult>(Task<TAntecedentResult>[], Func<Task<TAntecedentResult>,TResult>)

제공된 집합에서 작업이 완료될 때 시작할 연속 Task<TResult>를 만듭니다.Creates a continuation Task<TResult> that will be started upon the completion of any Task in the provided set.

public:
generic <typename TAntecedentResult, typename TResult>
 System::Threading::Tasks::Task<TResult> ^ ContinueWhenAny(cli::array <System::Threading::Tasks::Task<TAntecedentResult> ^> ^ tasks, Func<System::Threading::Tasks::Task<TAntecedentResult> ^, TResult> ^ continuationFunction);
public System.Threading.Tasks.Task<TResult> ContinueWhenAny<TAntecedentResult,TResult> (System.Threading.Tasks.Task<TAntecedentResult>[] tasks, Func<System.Threading.Tasks.Task<TAntecedentResult>,TResult> continuationFunction);
member this.ContinueWhenAny : System.Threading.Tasks.Task<'AntecedentResult>[] * Func<System.Threading.Tasks.Task<'AntecedentResult>, 'Result> -> System.Threading.Tasks.Task<'Result>
Public Function ContinueWhenAny(Of TAntecedentResult, TResult) (tasks As Task(Of TAntecedentResult)(), continuationFunction As Func(Of Task(Of TAntecedentResult), TResult)) As Task(Of TResult)

형식 매개 변수

TAntecedentResult

선행 tasks의 결과 형식입니다.The type of the result of the antecedent tasks.

TResult

continuationFunction 대리자가 반환하고 만들어진 Task<TResult>와 연결되는 결과의 형식입니다.The type of the result that is returned by the continuationFunction delegate and associated with the created Task<TResult>.

매개 변수

tasks
Task<TAntecedentResult>[]

작업이 완료될 때 계속할 작업의 배열입니다.The array of tasks from which to continue when one task completes.

continuationFunction
Func<Task<TAntecedentResult>,TResult>

tasks 배열에서 작업이 완료될 때 비동기로 실행할 함수 대리자입니다.The function delegate to execute asynchronously when one task in the tasks array completes.

반환

새 연속 Task<TResult>입니다.The new continuation Task<TResult>.

예외

tasks 배열에 있는 요소 중 하나가 삭제되었습니다.One of the elements in the tasks array has been disposed.

tasks 배열이 null인 경우The tasks array is null.

또는-or- continuationFunctionnull인 경우continuationFunction is null.

tasks 배열에 null 값이 들어 있습니다.The tasks array contains a null value.

또는-or- tasks 배열이 비어 있는 경우The tasks array is empty.

추가 정보

ContinueWhenAny<TAntecedentResult,TResult>(Task<TAntecedentResult>[], Func<Task<TAntecedentResult>,TResult>, CancellationToken)

제공된 집합에서 작업이 완료될 때 시작할 연속 Task<TResult>를 만듭니다.Creates a continuation Task<TResult> that will be started upon the completion of any Task in the provided set.

public:
generic <typename TAntecedentResult, typename TResult>
 System::Threading::Tasks::Task<TResult> ^ ContinueWhenAny(cli::array <System::Threading::Tasks::Task<TAntecedentResult> ^> ^ tasks, Func<System::Threading::Tasks::Task<TAntecedentResult> ^, TResult> ^ continuationFunction, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task<TResult> ContinueWhenAny<TAntecedentResult,TResult> (System.Threading.Tasks.Task<TAntecedentResult>[] tasks, Func<System.Threading.Tasks.Task<TAntecedentResult>,TResult> continuationFunction, System.Threading.CancellationToken cancellationToken);
member this.ContinueWhenAny : System.Threading.Tasks.Task<'AntecedentResult>[] * Func<System.Threading.Tasks.Task<'AntecedentResult>, 'Result> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Result>

형식 매개 변수

TAntecedentResult

선행 tasks의 결과 형식입니다.The type of the result of the antecedent tasks.

TResult

continuationFunction 대리자가 반환하고 만들어진 Task<TResult>와 연결되는 결과의 형식입니다.The type of the result that is returned by the continuationFunction delegate and associated with the created Task<TResult>.

매개 변수

tasks
Task<TAntecedentResult>[]

작업이 완료될 때 계속할 작업의 배열입니다.The array of tasks from which to continue when one task completes.

continuationFunction
Func<Task<TAntecedentResult>,TResult>

tasks 배열에서 작업이 완료될 때 비동기로 실행할 함수 대리자입니다.The function delegate to execute asynchronously when one task in the tasks array completes.

cancellationToken
CancellationToken

새 연속 작업에 할당할 CancellationToken입니다.The CancellationToken that will be assigned to the new continuation task.

반환

새 연속 Task<TResult>입니다.The new continuation Task<TResult>.

예외

tasks 배열에 있는 요소 중 하나가 삭제되었습니다.One of the elements in the tasks array has been disposed.

또는-or- 제공된 CancellationToken가 이미 삭제된 경우The provided CancellationToken has already been disposed.

tasks 배열이 null인 경우The tasks array is null.

또는-or- continuationFunctionnull입니다.continuationFunction is null.

tasks 배열에 null 값이 포함된 경우The tasks array contains a null value.

또는-or- tasks 배열이 비어 있는 경우The tasks array is empty.

추가 정보

ContinueWhenAny<TAntecedentResult,TResult>(Task<TAntecedentResult>[], Func<Task<TAntecedentResult>,TResult>, CancellationToken, TaskContinuationOptions, TaskScheduler)

제공된 집합에서 작업이 완료될 때 시작할 연속 Task<TResult>를 만듭니다.Creates a continuation Task<TResult> that will be started upon the completion of any Task in the provided set.

public:
generic <typename TAntecedentResult, typename TResult>
 System::Threading::Tasks::Task<TResult> ^ ContinueWhenAny(cli::array <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);
public System.Threading.Tasks.Task<TResult> ContinueWhenAny<TAntecedentResult,TResult> (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.ContinueWhenAny : 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>

형식 매개 변수

TAntecedentResult

선행 tasks의 결과 형식입니다.The type of the result of the antecedent tasks.

TResult

continuationFunction 대리자가 반환하고 만들어진 Task<TResult>와 연결되는 결과의 형식입니다.The type of the result that is returned by the continuationFunction delegate and associated with the created Task<TResult>.

매개 변수

tasks
Task<TAntecedentResult>[]

작업이 완료될 때 계속할 작업의 배열입니다.The array of tasks from which to continue when one task completes.

continuationFunction
Func<Task<TAntecedentResult>,TResult>

tasks 배열에서 작업이 완료될 때 비동기로 실행할 함수 대리자입니다.The function delegate to execute asynchronously when one task in the tasks array completes.

cancellationToken
CancellationToken

새 연속 작업에 할당할 CancellationToken입니다.The CancellationToken that will be assigned to the new continuation task.

continuationOptions
TaskContinuationOptions

만들어진 연속 TaskContinuationOptions의 동작을 제어하는 Task<TResult> 값입니다.The TaskContinuationOptions value that controls the behavior of the created continuation Task<TResult>.

scheduler
TaskScheduler

만들어진 연속 TaskScheduler를 예약하는 데 사용할 Task<TResult>입니다.The TaskScheduler that is used to schedule the created continuation Task<TResult>.

반환

새 연속 Task<TResult>입니다.The new continuation Task<TResult>.

예외

tasks 배열이 null인 경우The tasks array is null.

또는-or- continuationFunctionnull인 경우continuationFunction is null.

또는-or- schedulernull인 경우scheduler is null.

tasks 배열에 null 값이 들어 있습니다.The tasks array contains a null value.

또는-or- tasks 배열이 비어 있는 경우The tasks array is empty.

continuationOptions는 잘못된 TaskContinuationOptions 값을 지정합니다.continuationOptions specifies an invalid TaskContinuationOptions value.

제공된 CancellationToken가 이미 삭제된 경우The provided CancellationToken has already been disposed.

설명

연속 작업이 실행 될 TaskStatus 상태를 제한 하는 NotOn @ no__t-0 및 전용 @ no__t-1 TaskContinuationOptionsContinueWhenAny에서 사용할 수 없습니다.The NotOn* and OnlyOn* TaskContinuationOptions, which constrain for which TaskStatus states a continuation will be executed, are illegal with ContinueWhenAny.

추가 정보

ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[], Action<Task<TAntecedentResult>>)

제공된 집합에서 작업이 완료될 때 시작할 연속 Task를 만듭니다.Creates a continuation Task that will be started upon the completion of any Task in the provided set.

public:
generic <typename TAntecedentResult>
 System::Threading::Tasks::Task ^ ContinueWhenAny(cli::array <System::Threading::Tasks::Task<TAntecedentResult> ^> ^ tasks, Action<System::Threading::Tasks::Task<TAntecedentResult> ^> ^ continuationAction);
public System.Threading.Tasks.Task ContinueWhenAny<TAntecedentResult> (System.Threading.Tasks.Task<TAntecedentResult>[] tasks, Action<System.Threading.Tasks.Task<TAntecedentResult>> continuationAction);
member this.ContinueWhenAny : System.Threading.Tasks.Task<'AntecedentResult>[] * Action<System.Threading.Tasks.Task<'AntecedentResult>> -> System.Threading.Tasks.Task
Public Function ContinueWhenAny(Of TAntecedentResult) (tasks As Task(Of TAntecedentResult)(), continuationAction As Action(Of Task(Of TAntecedentResult))) As Task

형식 매개 변수

TAntecedentResult

선행 tasks의 결과 형식입니다.The type of the result of the antecedent tasks.

매개 변수

tasks
Task<TAntecedentResult>[]

작업이 완료될 때 계속할 작업의 배열입니다.The array of tasks from which to continue when one task completes.

continuationAction
Action<Task<TAntecedentResult>>

tasks 배열에서 작업이 완료될 때 실행할 동작 대리자입니다.The action delegate to execute when one task in the tasks array completes.

반환

새 연속 Task입니다.The new continuation Task.

예외

tasks 배열에 있는 요소 중 하나가 삭제되었습니다.One of the elements in the tasks array has been disposed.

tasks 배열이 null인 경우The tasks array is null.

또는-or- continuationActionnull인 경우continuationAction is null.

tasks 배열에 null 값이 포함된 경우The tasks array contains a null value.

또는-or- tasks 배열이 비어 있는 경우The tasks array is empty.

추가 정보

ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[], Action<Task<TAntecedentResult>>, CancellationToken)

제공된 집합에서 작업이 완료될 때 시작할 연속 Task를 만듭니다.Creates a continuation Task that will be started upon the completion of any Task in the provided set.

public:
generic <typename TAntecedentResult>
 System::Threading::Tasks::Task ^ ContinueWhenAny(cli::array <System::Threading::Tasks::Task<TAntecedentResult> ^> ^ tasks, Action<System::Threading::Tasks::Task<TAntecedentResult> ^> ^ continuationAction, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task ContinueWhenAny<TAntecedentResult> (System.Threading.Tasks.Task<TAntecedentResult>[] tasks, Action<System.Threading.Tasks.Task<TAntecedentResult>> continuationAction, System.Threading.CancellationToken cancellationToken);
member this.ContinueWhenAny : System.Threading.Tasks.Task<'AntecedentResult>[] * Action<System.Threading.Tasks.Task<'AntecedentResult>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task

형식 매개 변수

TAntecedentResult

선행 tasks의 결과 형식입니다.The type of the result of the antecedent tasks.

매개 변수

tasks
Task<TAntecedentResult>[]

작업이 완료될 때 계속할 작업의 배열입니다.The array of tasks from which to continue when one task completes.

continuationAction
Action<Task<TAntecedentResult>>

tasks 배열에서 작업이 완료될 때 실행할 동작 대리자입니다.The action delegate to execute when one task in the tasks array completes.

cancellationToken
CancellationToken

새 연속 작업에 할당할 CancellationToken입니다.The CancellationToken that will be assigned to the new continuation task.

반환

새 연속 Task입니다.The new continuation Task.

예외

tasks 배열에 있는 요소 중 하나가 삭제되었습니다.One of the elements in the tasks array has been disposed.

또는-or- 제공된 CancellationToken가 이미 삭제된 경우The provided CancellationToken has already been disposed.

tasks 배열이 null인 경우The tasks array is null.

또는-or- continuationActionnull입니다.continuationAction is null.

tasks 배열에 null 값이 들어 있습니다.The tasks array contains a null value.

또는-or- tasks 배열이 비어 있는 경우The tasks array is empty.

추가 정보

ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[], Action<Task<TAntecedentResult>>, TaskContinuationOptions)

제공된 집합에서 작업이 완료될 때 시작할 연속 Task를 만듭니다.Creates a continuation Task that will be started upon the completion of any Task in the provided set.

public:
generic <typename TAntecedentResult>
 System::Threading::Tasks::Task ^ ContinueWhenAny(cli::array <System::Threading::Tasks::Task<TAntecedentResult> ^> ^ tasks, Action<System::Threading::Tasks::Task<TAntecedentResult> ^> ^ continuationAction, System::Threading::Tasks::TaskContinuationOptions continuationOptions);
public System.Threading.Tasks.Task ContinueWhenAny<TAntecedentResult> (System.Threading.Tasks.Task<TAntecedentResult>[] tasks, Action<System.Threading.Tasks.Task<TAntecedentResult>> continuationAction, System.Threading.Tasks.TaskContinuationOptions continuationOptions);
member this.ContinueWhenAny : System.Threading.Tasks.Task<'AntecedentResult>[] * Action<System.Threading.Tasks.Task<'AntecedentResult>> * System.Threading.Tasks.TaskContinuationOptions -> System.Threading.Tasks.Task
Public Function ContinueWhenAny(Of TAntecedentResult) (tasks As Task(Of TAntecedentResult)(), continuationAction As Action(Of Task(Of TAntecedentResult)), continuationOptions As TaskContinuationOptions) As Task

형식 매개 변수

TAntecedentResult

선행 tasks의 결과 형식입니다.The type of the result of the antecedent tasks.

매개 변수

tasks
Task<TAntecedentResult>[]

작업이 완료될 때 계속할 작업의 배열입니다.The array of tasks from which to continue when one task completes.

continuationAction
Action<Task<TAntecedentResult>>

tasks 배열에서 작업이 완료될 때 실행할 동작 대리자입니다.The action delegate to execute when one task in the tasks array completes.

continuationOptions
TaskContinuationOptions

만들어진 연속 TaskContinuationOptions의 동작을 제어하는 Task 값입니다.The TaskContinuationOptions value that controls the behavior of the created continuation Task.

반환

새 연속 Task입니다.The new continuation Task.

예외

tasks 배열에 있는 요소 중 하나가 삭제되었습니다.One of the elements in the tasks array has been disposed.

tasks 배열이 null인 경우The tasks array is null.

또는-or- continuationActionnull인 경우continuationAction is null.

continuationOptions는 잘못된 TaskContinuationOptions 값을 지정합니다.continuationOptions specifies an invalid TaskContinuationOptions value.

tasks 배열에 null 값이 들어 있습니다.The tasks array contains a null value.

또는-or- tasks 배열이 비어 있는 경우The tasks array is empty.

설명

연속 작업이 실행 될 TaskStatus 상태를 제한 하는 NotOn @ no__t-0 및 전용 @ no__t-1 TaskContinuationOptionsContinueWhenAny에서 사용할 수 없습니다.The NotOn* and OnlyOn* TaskContinuationOptions, which constrain for which TaskStatus states a continuation will be executed, are illegal with ContinueWhenAny.

추가 정보

ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[], Action<Task<TAntecedentResult>>, CancellationToken, TaskContinuationOptions, TaskScheduler)

제공된 집합에서 작업이 완료될 때 시작할 연속 Task를 만듭니다.Creates a continuation Task that will be started upon the completion of any Task in the provided set.

public:
generic <typename TAntecedentResult>
 System::Threading::Tasks::Task ^ ContinueWhenAny(cli::array <System::Threading::Tasks::Task<TAntecedentResult> ^> ^ tasks, Action<System::Threading::Tasks::Task<TAntecedentResult> ^> ^ continuationAction, System::Threading::CancellationToken cancellationToken, System::Threading::Tasks::TaskContinuationOptions continuationOptions, System::Threading::Tasks::TaskScheduler ^ scheduler);
public System.Threading.Tasks.Task ContinueWhenAny<TAntecedentResult> (System.Threading.Tasks.Task<TAntecedentResult>[] tasks, Action<System.Threading.Tasks.Task<TAntecedentResult>> continuationAction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler);
member this.ContinueWhenAny : System.Threading.Tasks.Task<'AntecedentResult>[] * Action<System.Threading.Tasks.Task<'AntecedentResult>> * System.Threading.CancellationToken * System.Threading.Tasks.TaskContinuationOptions * System.Threading.Tasks.TaskScheduler -> System.Threading.Tasks.Task

형식 매개 변수

TAntecedentResult

선행 tasks의 결과 형식입니다.The type of the result of the antecedent tasks.

매개 변수

tasks
Task<TAntecedentResult>[]

작업이 완료될 때 계속할 작업의 배열입니다.The array of tasks from which to continue when one task completes.

continuationAction
Action<Task<TAntecedentResult>>

tasks 배열에서 작업이 완료될 때 실행할 동작 대리자입니다.The action delegate to execute when one task in the tasks array completes.

cancellationToken
CancellationToken

새 연속 작업에 할당할 CancellationToken입니다.The CancellationToken that will be assigned to the new continuation task.

continuationOptions
TaskContinuationOptions

만들어진 연속 TaskContinuationOptions의 동작을 제어하는 Task 값입니다.The TaskContinuationOptions value that controls the behavior of the created continuation Task.

scheduler
TaskScheduler

만들어진 연속 TaskScheduler를 예약하는 데 사용할 Task<TResult>입니다.The TaskScheduler that is used to schedule the created continuation Task<TResult>.

반환

새 연속 Task입니다.The new continuation Task.

예외

tasks 배열이 null인 경우The tasks array is null.

또는-or- continuationActionnull인 경우continuationAction is null.

또는-or- paramref name="scheduler" />는 null입니다.paramref name="scheduler" /> is null.

tasks 배열에 null 값이 포함된 경우The tasks array contains a null value.

또는-or- tasks 배열이 비어 있는 경우The tasks array is empty.

continuationOptions가 잘못된 TaskContinuationOptions 값을 지정합니다.continuationOptions specifies an invalid TaskContinuationOptions value.

제공된 CancellationToken가 이미 삭제된 경우The provided CancellationToken has already been disposed.

설명

연속 작업이 실행 될 TaskStatus 상태를 제한 하는 NotOn @ no__t-0 및 전용 @ no__t-1 TaskContinuationOptionsContinueWhenAny에서 사용할 수 없습니다.The NotOn* and OnlyOn* TaskContinuationOptions, which constrain for which TaskStatus states a continuation will be executed, are illegal with ContinueWhenAny.

추가 정보

ContinueWhenAny<TResult>(Task[], Func<Task,TResult>)

제공된 집합에서 작업이 완료될 때 시작할 연속 Task<TResult>를 만듭니다.Creates a continuation Task<TResult> that will be started upon the completion of any Task in the provided set.

public:
generic <typename TResult>
 System::Threading::Tasks::Task<TResult> ^ ContinueWhenAny(cli::array <System::Threading::Tasks::Task ^> ^ tasks, Func<System::Threading::Tasks::Task ^, TResult> ^ continuationFunction);
public System.Threading.Tasks.Task<TResult> ContinueWhenAny<TResult> (System.Threading.Tasks.Task[] tasks, Func<System.Threading.Tasks.Task,TResult> continuationFunction);
member this.ContinueWhenAny : System.Threading.Tasks.Task[] * Func<System.Threading.Tasks.Task, 'Result> -> System.Threading.Tasks.Task<'Result>
Public Function ContinueWhenAny(Of TResult) (tasks As Task(), continuationFunction As Func(Of Task, TResult)) As Task(Of TResult)

형식 매개 변수

TResult

continuationFunction 대리자가 반환하고 만들어진 Task<TResult>와 연결되는 결과의 형식입니다.The type of the result that is returned by the continuationFunction delegate and associated with the created Task<TResult>.

매개 변수

tasks
Task[]

작업이 완료될 때 계속할 작업의 배열입니다.The array of tasks from which to continue when one task completes.

continuationFunction
Func<Task,TResult>

tasks 배열에서 작업이 완료될 때 비동기로 실행할 함수 대리자입니다.The function delegate to execute asynchronously when one task in the tasks array completes.

반환

새 연속 Task<TResult>입니다.The new continuation Task<TResult>.

예외

tasks 배열에 있는 요소 중 하나가 삭제되었습니다.One of the elements in the tasks array has been disposed.

tasks 배열이 null인 경우The tasks array is null.

또는-or- continuationFunctionnull인 경우continuationFunction is null.

tasks 배열에 null 값이 들어 있습니다.The tasks array contains a null value.

또는-or- tasks 배열이 비어 있는 경우The tasks array is empty.

추가 정보

ContinueWhenAny<TResult>(Task[], Func<Task,TResult>, CancellationToken)

제공된 집합에서 작업이 완료될 때 시작할 연속 Task<TResult>를 만듭니다.Creates a continuation Task<TResult> that will be started upon the completion of any Task in the provided set.

public:
generic <typename TResult>
 System::Threading::Tasks::Task<TResult> ^ ContinueWhenAny(cli::array <System::Threading::Tasks::Task ^> ^ tasks, Func<System::Threading::Tasks::Task ^, TResult> ^ continuationFunction, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task<TResult> ContinueWhenAny<TResult> (System.Threading.Tasks.Task[] tasks, Func<System.Threading.Tasks.Task,TResult> continuationFunction, System.Threading.CancellationToken cancellationToken);
member this.ContinueWhenAny : System.Threading.Tasks.Task[] * Func<System.Threading.Tasks.Task, 'Result> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Result>

형식 매개 변수

TResult

continuationFunction 대리자가 반환하고 만들어진 Task<TResult>와 연결되는 결과의 형식입니다.The type of the result that is returned by the continuationFunction delegate and associated with the created Task<TResult>.

매개 변수

tasks
Task[]

작업이 완료될 때 계속할 작업의 배열입니다.The array of tasks from which to continue when one task completes.

continuationFunction
Func<Task,TResult>

tasks 배열에서 작업이 완료될 때 비동기로 실행할 함수 대리자입니다.The function delegate to execute asynchronously when one task in the tasks array completes.

cancellationToken
CancellationToken

새 연속 작업에 할당할 CancellationToken입니다.The CancellationToken that will be assigned to the new continuation task.

반환

새 연속 Task<TResult>입니다.The new continuation Task<TResult>.

예외

tasks 배열에 있는 요소 중 하나가 삭제되었습니다.One of the elements in the tasks array has been disposed.

또는-or- 제공된 CancellationToken가 이미 삭제된 경우The provided CancellationToken has already been disposed.

tasks 배열이 null인 경우The tasks array is null.

또는-or- continuationFunctionnull인 경우continuationFunction is null.

tasks 배열에 null 값이 포함된 경우The tasks array contains a null value.

또는-or- tasks 배열이 비어 있는 경우The tasks array is empty.

추가 정보

ContinueWhenAny<TResult>(Task[], Func<Task,TResult>, TaskContinuationOptions)

제공된 집합에서 작업이 완료될 때 시작할 연속 Task<TResult>를 만듭니다.Creates a continuation Task<TResult> that will be started upon the completion of any Task in the provided set.

public:
generic <typename TResult>
 System::Threading::Tasks::Task<TResult> ^ ContinueWhenAny(cli::array <System::Threading::Tasks::Task ^> ^ tasks, Func<System::Threading::Tasks::Task ^, TResult> ^ continuationFunction, System::Threading::Tasks::TaskContinuationOptions continuationOptions);
public System.Threading.Tasks.Task<TResult> ContinueWhenAny<TResult> (System.Threading.Tasks.Task[] tasks, Func<System.Threading.Tasks.Task,TResult> continuationFunction, System.Threading.Tasks.TaskContinuationOptions continuationOptions);
member this.ContinueWhenAny : System.Threading.Tasks.Task[] * Func<System.Threading.Tasks.Task, 'Result> * System.Threading.Tasks.TaskContinuationOptions -> System.Threading.Tasks.Task<'Result>
Public Function ContinueWhenAny(Of TResult) (tasks As Task(), continuationFunction As Func(Of Task, TResult), continuationOptions As TaskContinuationOptions) As Task(Of TResult)

형식 매개 변수

TResult

continuationFunction 대리자가 반환하고 만들어진 Task<TResult>와 연결되는 결과의 형식입니다.The type of the result that is returned by the continuationFunction delegate and associated with the created Task<TResult>.

매개 변수

tasks
Task[]

작업이 완료될 때 계속할 작업의 배열입니다.The array of tasks from which to continue when one task completes.

continuationFunction
Func<Task,TResult>

tasks 배열에서 작업이 완료될 때 비동기로 실행할 함수 대리자입니다.The function delegate to execute asynchronously when one task in the tasks array completes.

continuationOptions
TaskContinuationOptions

만들어진 연속 TaskContinuationOptions의 동작을 제어하는 Task<TResult> 값입니다.The TaskContinuationOptions value that controls the behavior of the created continuation Task<TResult>.

반환

새 연속 Task<TResult>입니다.The new continuation Task<TResult>.

예외

tasks 배열에 있는 요소 중 하나가 삭제되었습니다.One of the elements in the tasks array has been disposed.

tasks 배열이 null인 경우The tasks array is null.

또는-or- continuationFunctionnull인 경우continuationFunction is null.

continuationOptions는 잘못된 TaskContinuationOptions 값을 지정합니다.continuationOptions specifies an invalid TaskContinuationOptions value.

tasks 배열에 null 값이 포함된 경우The tasks array contains a null value.

또는-or- tasks 배열이 비어 있는 경우The tasks array is empty.

설명

연속 작업이 실행 될 TaskStatus 상태를 제한 하는 NotOn @ no__t-0 및 전용 @ no__t-1 TaskContinuationOptionsContinueWhenAny에서 사용할 수 없습니다.The NotOn* and OnlyOn* TaskContinuationOptions, which constrain for which TaskStatus states a continuation will be executed, are illegal with ContinueWhenAny.

추가 정보

ContinueWhenAny<TResult>(Task[], Func<Task,TResult>, CancellationToken, TaskContinuationOptions, TaskScheduler)

제공된 집합에서 작업이 완료될 때 시작할 연속 Task<TResult>를 만듭니다.Creates a continuation Task<TResult> that will be started upon the completion of any Task in the provided set.

public:
generic <typename TResult>
 System::Threading::Tasks::Task<TResult> ^ ContinueWhenAny(cli::array <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);
public System.Threading.Tasks.Task<TResult> ContinueWhenAny<TResult> (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.ContinueWhenAny : 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>

형식 매개 변수

TResult

continuationFunction 대리자가 반환하고 만들어진 Task<TResult>와 연결되는 결과의 형식입니다.The type of the result that is returned by the continuationFunction delegate and associated with the created Task<TResult>.

매개 변수

tasks
Task[]

작업이 완료될 때 계속할 작업의 배열입니다.The array of tasks from which to continue when one task completes.

continuationFunction
Func<Task,TResult>

tasks 배열에서 작업이 완료될 때 비동기로 실행할 함수 대리자입니다.The function delegate to execute asynchronously when one task in the tasks array completes.

cancellationToken
CancellationToken

새 연속 작업에 할당할 CancellationToken입니다.The CancellationToken that will be assigned to the new continuation task.

continuationOptions
TaskContinuationOptions

만들어진 연속 TaskContinuationOptions의 동작을 제어하는 Task<TResult> 값입니다.The TaskContinuationOptions value that controls the behavior of the created continuation Task<TResult>.

scheduler
TaskScheduler

만들어진 연속 TaskScheduler를 예약하는 데 사용할 Task<TResult>입니다.The TaskScheduler that is used to schedule the created continuation Task<TResult>.

반환

새 연속 Task<TResult>입니다.The new continuation Task<TResult>.

예외

tasks 배열이 null인 경우The tasks array is null.

또는-or- continuationFunctionnull인 경우continuationFunction is null.

또는-or- schedulernull인 경우scheduler is null.

tasks 배열에 null 값이 포함된 경우The tasks array contains a null value.

또는-or- tasks 배열이 비어 있는 경우The tasks array is empty.

continuationOptions는 잘못된 TaskContinuationOptions 값을 지정합니다.continuationOptions specifies an invalid TaskContinuationOptions value.

제공된 CancellationToken가 이미 삭제된 경우The provided CancellationToken has already been disposed.

설명

연속 작업이 실행 될 TaskStatus 상태를 제한 하는 NotOn @ no__t-0 및 전용 @ no__t-1 TaskContinuationOptionsContinueWhenAny에서 사용할 수 없습니다.The NotOn* and OnlyOn* TaskContinuationOptions, which constrain for which TaskStatus states a continuation will be executed, are illegal with ContinueWhenAny.

추가 정보

적용 대상