Interface CircuitBreaker

All Known Implementing Classes:
NoopCircuitBreaker

public interface CircuitBreaker
The CircuitBreaker interface defines the external integration points between an implementation and its calling BaseEndpoint.

See the individual implementation for details on how they work. Note that they are all configured through the CircuitBreakerConfig that is configured on the environment on a per service basis and applied on a per endpoint basis.

Since:
2.0.0
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Defines if a request is considered a success or a failure.
    static enum 
    Represents all the states a circuit breaker can be in, possibly.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true if requests are allowed to go through and be tracked.
    void
    The tracked request is marked failure.
    void
    The tracked request is marked succeeded.
    void
    Resets this circuit breaker to its initial state.
    Returns the current state of the circuit breaker.
    void
    Marks that a circuit breaker should start tracking.
  • Method Details

    • track

      void track()
      Marks that a circuit breaker should start tracking.
    • markSuccess

      void markSuccess()
      The tracked request is marked succeeded.
    • markFailure

      void markFailure()
      The tracked request is marked failure.
    • reset

      void reset()
      Resets this circuit breaker to its initial state.
    • allowsRequest

      boolean allowsRequest()
      Returns true if requests are allowed to go through and be tracked.
    • state

      Returns the current state of the circuit breaker.