Interface CircuitBreaker

  • All Known Implementing Classes:
    ZestCircuitBreaker

    public interface CircuitBreaker
    Basic abstract interface for circuit breaker implementation.
    • 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.