executeRace

suspend fun <T> executeRace(timeout: Duration? = null, blocks: List<suspend () -> T>): T(source)

Executes the first operation that completes within the timeout.

Return

The result of the first completing operation

Parameters

timeout

Timeout for the race

blocks

List of operations to race

Throws

if all operations time out