execute

abstract suspend fun <T> execute(block: suspend () -> T): T

Executes block with multiple parallel attempts; returns the first successful result or throws if all fail.

Return

The result of the first successful execution.

Parameters

block

The suspendable operation to execute (possibly multiple times in parallel).

Type Parameters

T

The return type of the block.

Throws

The first failure if all attempts fail.