Race(IReadOnlyList<ScheduledTask>, CancellationToken)
static
public static Task<ScheduledTask> Race(IReadOnlyList<ScheduledTask> tasks, CancellationToken cancellationToken = default(CancellationToken)) Waits for the first scheduled task to complete, requests durable cancellation of every other task, waits until every task is terminal, and returns the first task.
Parameters
tasksIReadOnlyList<ScheduledTask>- The tasks, which are captured when this method is called.
cancellationTokenCancellationToken- A token which abandons the wait. It doesn't cancel the tasks.
Returns
The task which completed first, including a task which failed or was canceled. Every task has observed its terminal response, so
ScheduledTask, ScheduledTask, and Orleans.Durable.Tasks.ScheduledTask.TryGetResult inspect the winner and the other tasks. Exceptions
System.ArgumentOutOfRangeExceptiontasksis empty.
