Interface CircuitBreaker
-
- All Known Implementing Classes:
ZestCircuitBreaker
public interface CircuitBreakerBasic abstract interface for circuit breaker implementation.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanallowRequest()Is request is allowed to go through (is circuit breaker closed or opened).voidmarkFailure(Throwable cause)Reports about failure conditions to circuit breaker.voidmarkSuccess()Reports about successful invocation to circuit breaker.
-
-
-
Method Detail
-
allowRequest
boolean allowRequest()
Is request is allowed to go through (is circuit breaker closed or opened).- Returns:
- "false" if circuit breaker is open, "true" otherwise
-
markFailure
void markFailure(Throwable cause)
Reports about failure conditions to circuit breaker.- Parameters:
cause- exception happened (could be null in case the error is deducted from response status/code).
-
markSuccess
void markSuccess()
Reports about successful invocation to circuit breaker.
-
-