customDelayInOpenState

fun customDelayInOpenState(delayStrategyInOpenState: DelayStrategy)(source)

Configures the circuit breaker delay strategy to use a custom delay between transitions from Open to HalfOpen, based on the current attempt and additional context. The current attempt is the number of times the circuit breaker is in the Open state in one cycle.

Example:

customDelayInOpenState { attempt ->
if (attempt % 2 == 0) 1.seconds
else 2.seconds
}

Parameters

delayStrategyInOpenState

the custom delay strategy to use.

See also