execute

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

Executes block if the circuit allows it; otherwise throws CircuitBreakerOpenException.

Return

The result of block when the circuit is closed or half-open and the call is allowed.

Parameters

block

The suspendable operation to execute.

Type Parameters

T

The return type of the block.

Throws

When the circuit is open or half-open and the call limit is reached.