# DurableTask.Race(IReadOnlyList&lt;DurableTask&gt;)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.durabletask/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.durabletask/methods/)

[Source](https://github.com/dotnet/orleans/blob/6a0e937f544c35ffcf11b37e4c2b7de5a1580a03/src/Orleans.Durable.Abstractions/DurableTask.Race.cs)

```csharp
public static DurableTask<int> Race(IReadOnlyList<DurableTask> tasks)
```

Creates a durable task which returns the input index of the first input task to complete, after requesting cancellation of every other input and waiting until each is terminal.

### Parameters

- `tasks` (`IReadOnlyList<DurableTask>`): The input tasks, which are captured when this method is called.

### Returns

A combinator which, awaited within a durable execution, runs as part of that execution.

### Exceptions

- `System.ArgumentOutOfRangeException`: `tasks` is empty.
