execute

suspend fun <T> execute(timeout: Duration? = null, block: suspend () -> T): T(source)

Executes an operation with a timeout.

Return

The result of the operation

Parameters

timeout

Optional custom timeout (overrides config timeout)

block

The operation to execute

Throws

if the operation times out

if the operation fails