Interface CircuitBreaker
- All Known Implementing Classes:
ZestCircuitBreaker
public interface CircuitBreaker
Basic abstract interface for circuit breaker implementation.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanIs request is allowed to go through (is circuit breaker closed or opened).voidmarkFailure(Throwable cause) Reports about failure conditions to circuit breaker.voidReports about successful invocation to circuit breaker.
-
Method Details
-
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
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.
-