java.lang.Object
com.linecorp.armeria.common.util.AbstractUnwrappable<Client<T_I,T_O>>
com.linecorp.armeria.client.DecoratingClient<I,O,I,O>
com.linecorp.armeria.client.SimpleDecoratingClient<I,O>
com.linecorp.armeria.client.circuitbreaker.AbstractCircuitBreakerClient<I,O>
- All Implemented Interfaces:
Client<I,O>
,Unwrappable
- Direct Known Subclasses:
CircuitBreakerClient
,CircuitBreakerRpcClient
public abstract class AbstractCircuitBreakerClient<I extends Request,O extends Response> extends SimpleDecoratingClient<I,O>
A
Client
decorator that handles failures of remote invocation based on circuit breaker pattern.-
Method Summary
Modifier and Type Method Description protected abstract O
doExecute(ClientRequestContext ctx, I req, CircuitBreaker circuitBreaker)
Invoked when theCircuitBreaker
is in closed state.O
execute(ClientRequestContext ctx, I req)
protected static void
reportSuccessOrFailure(CircuitBreaker circuitBreaker, CompletionStage<CircuitBreakerDecision> future)
Reports a success or a failure to the specifiedCircuitBreaker
according to the completed value of the specifiedfuture
.Methods inherited from class com.linecorp.armeria.common.util.AbstractUnwrappable
as, delegate, toString, unwrap
-
Method Details
-
execute
Description copied from interface:Client
-
doExecute
protected abstract O doExecute(ClientRequestContext ctx, I req, CircuitBreaker circuitBreaker) throws ExceptionInvoked when theCircuitBreaker
is in closed state.- Throws:
Exception
-
reportSuccessOrFailure
protected static void reportSuccessOrFailure(CircuitBreaker circuitBreaker, CompletionStage<CircuitBreakerDecision> future)Reports a success or a failure to the specifiedCircuitBreaker
according to the completed value of the specifiedfuture
. If the completed value isCircuitBreakerDecision.ignore()
, this doesn't do anything.
-