executeOrDefault

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

Executes an operation with a timeout and default value.

Return

The result of the operation or default value

Parameters

timeout

Optional custom timeout (overrides config timeout)

default

The default value to return if the operation times out

block

The operation to execute