Skip to main content
Corvus Connection

Race

Concurrency
flow.raceRuns each connected branch concurrently and continues as soon as the first one finishes (Task.WhenAny). Binds the winning branch index to 'winner' and cancels the losing branches.First-past-the-post over up to four branches; losers are cancelled.

Inputs

Name
Kind
Type
Flags
inExecexecmultiplexed

Outputs

Name
Kind
Type
Flags
branch0ExecexecNone
branch1ExecexecNone
branch2ExecexecNone
branch3ExecexecNone
winnerDataSystem.Int32multiplexed
completedExecexecNone

Lowers to C#

var winner = await Task.WhenAny(branch0(), …); cts.Cancel(); /* → completed */

Used in