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 attempt is the number of times the circuit breaker transitioned from Open to HalfOpen.

Example:

customDelayInOpenState { attempt ->
attempt % 2 == 0 -> 1.seconds
else -> 3.seconds
}

Where:

  • attempt is the current retry attempt. Starts at 1.

Parameters

delayStrategyInOpenState

the custom delay strategy to use.

See also