execute

open suspend override fun <T> execute(block: suspend () -> T): T

Executes block with a time limit. If execution exceeds the configured timeout, it is cancelled.

Return

The result of block when it completes within the timeout.

Parameters

block

The suspendable operation to execute.

Type Parameters

T

The return type of the block.

Throws

kotlinx.coroutines.TimeoutCancellationException

When the timeout is exceeded.