接口 CircuitBreaker
public interface CircuitBreaker
Basic circuit breaker interface.
- 作者:
- Eric Zhao
-
嵌套类概要
嵌套类 -
方法概要
修饰符和类型方法说明Get current state of the circuit breaker.getRule()Get the associated circuit breaking rule.voidonRequestComplete(Context context) Record a completed request with the context and handle state transformation of the circuit breaker.booleanAcquires permission of an invocation only if it is available at the time of invoking.
-
方法详细资料
-
getRule
DegradeRule getRule()Get the associated circuit breaking rule.- 返回:
- associated circuit breaking rule
-
tryPass
Acquires permission of an invocation only if it is available at the time of invoking.- 参数:
context- context of current invocation- 返回:
trueif permission was acquired andfalseotherwise
-
currentState
CircuitBreaker.State currentState()Get current state of the circuit breaker.- 返回:
- current state of the circuit breaker
-
onRequestComplete
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 invocation
-