raceOrFail

abstract fun raceOrFail(context: CoroutineContext = EmptyCoroutineContext, block: suspend CoroutineScope.() -> Result)

Races a coroutine block against other blocks in the racing scope. If the block throws an exception or raises an error through arrow.core.raise.Raise, it will be propagated and cancel the entire racing scope. The block will be cancelled if another block completes first.

Parameters

context

The CoroutineContext to run the block in.

block

The coroutine block to race.