Class HalfOpenState<R>

    • Field Detail

      • permittedExecutions

        protected final java.util.concurrent.atomic.AtomicInteger permittedExecutions
    • Method Detail

      • checkThreshold

        void checkThreshold​(ExecutionContext<R> context)
        Checks to determine if a threshold has been met and the circuit should be opened or closed.

        If a success threshold is configured, the circuit is opened or closed based on whether the ratio was exceeded.

        Else the circuit is opened or closed based on whether the failure threshold was exceeded.

        Overrides:
        checkThreshold in class CircuitState<R>
      • capacityFor

        private static int capacityFor​(CircuitBreaker<?> breaker)
        Returns the capacity of the breaker in the half-open state.