Interface CircuitBreaker

All Known Implementing Classes:
ZestCircuitBreaker

public interface CircuitBreaker
Basic abstract interface for circuit breaker implementation.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Is request is allowed to go through (is circuit breaker closed or opened).
    void
    Reports about failure conditions to circuit breaker.
    void
    Reports 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

      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.