Class ExecutorCircuitBreaker

    • Field Detail

      • timeout

        protected java.util.Optional<java.time.Duration> timeout
    • Constructor Detail

      • ExecutorCircuitBreaker

        public ExecutorCircuitBreaker​(java.lang.Integer circuitCheckIntervalInMillis)
      • ExecutorCircuitBreaker

        public ExecutorCircuitBreaker​(java.lang.Integer circuitCheckIntervalInMillis,
                                      java.time.Duration timeout)
    • Method Detail

      • run

        public <T> T run​(java.util.concurrent.Callable<T> callable)
        Specified by:
        run in interface CircuitBreaker
        Type Parameters:
        T - callable generic type
        Parameters:
        callable - The callable to be run
        Returns:
        result of callable
      • getTimeout

        public java.util.Optional<java.time.Duration> getTimeout()
      • isPercentageValueValid

        protected boolean isPercentageValueValid​(java.lang.Integer value)