public interface CircuitBreakersPanel
Calls to remote services can make use of this facility in order to add circuit breaking capabilities to it.
<T> CompletionStage<T> withCircuitBreaker(String id, Supplier<CompletionStage<T>> body)
bodyin the context of the circuit breaker identified by
body.get()is actually invoked is implementation-dependent, but implementations should call it at most once.
T- the result type
id- the unique identifier for the circuit breaker to use (often a service name)
body- effect to (optionally) execute within the context of the circuit breaker. May throw a
RuntimeExceptionto signal failure.
body.get(), or failing with an implementation-dependent exception.