T - the response type@FunctionalInterface public interface CircuitBreakerStrategyWithContent<T extends Response>
Response should be reported as a success or a failure to a
CircuitBreaker using the content of a Response. If you just need the HTTP headers
to make a decision, use CircuitBreakerStrategy for efficiency.| Modifier and Type | Method and Description |
|---|---|
CompletionStage<Boolean> |
shouldReportAsSuccess(ClientRequestContext ctx,
T response)
|
CompletionStage<Boolean> shouldReportAsSuccess(ClientRequestContext ctx, T response)
CompletionStage that contains true, false or
null according to the specified Response.
If true is returned, CircuitBreaker.onSuccess() is called so that the
CircuitBreaker increases its success count and uses it to make a decision
to close or open the circuit. If false is returned, it works the other way around.
If null is returned, the CircuitBreaker ignores it.ctx - the ClientRequestContext of this requestresponse - the Response from the serverCopyright © 2020 LeanCloud. All rights reserved.