executeOrNull

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

Executes an operation with a timeout, returning null if it times out.

Return

The result of the operation or null if it times out

Parameters

timeout

Optional custom timeout (overrides config timeout)

block

The operation to execute

Throws

if the operation fails (not timeout)