public interface CircuitBreaker
Basic circuit breaker interface.
| Modifier and Type | Interface and Description |
|---|---|
static class |
CircuitBreaker.State
Circuit breaker state.
|
| Modifier and Type | Method and Description |
|---|---|
CircuitBreaker.State |
currentState()
Get current state of the circuit breaker.
|
DegradeRule |
getRule()
Get the associated circuit breaking rule.
|
void |
onRequestComplete(Context context)
Record a completed request with the context and handle state transformation of the circuit breaker.
|
boolean |
tryPass(Context context)
Acquires permission of an invocation only if it is available at the time of invoking.
|
DegradeRule getRule()
boolean tryPass(Context context)
context - context of current invocationtrue if permission was acquired and false otherwiseCircuitBreaker.State currentState()
void onRequestComplete(Context context)
Record a completed request with the context and handle state transformation of the circuit breaker.
Called when a passed invocation finished.
context - context of current invocationCopyright © 2021 Alibaba Group. All rights reserved.