CircuitBreak

Provide simple Circuit Breaker. Returns ServiceUnavailable when the circuit is open. By default, uses a % failure rate of 50% detection and an Circuit Open period of 1minute

Functions

Link copied to clipboard
operator fun invoke(cb: CircuitBreaker = CircuitBreaker.ofDefaults("Circuit"), isError: (Response) -> Boolean = { it.status.serverError }, onError: () -> Response = { Response(SERVICE_UNAVAILABLE.description("Circuit is open")) }): Filter