Class ExponentialDelayWithoutJitter

  • All Implemented Interfaces:
    BackoffStrategy

    public final class ExponentialDelayWithoutJitter
    extends Object
    implements BackoffStrategy
    Strategy that waits for an exponentially increasing amount of time between each subsequent attempt of the same call.

    Specifically, the first attempt waits 0ms, and each subsequent attempt waits for min(maxDelay, baseDelay * (1 << (attempt - 2))).

    • Constructor Detail

      • ExponentialDelayWithoutJitter

        public ExponentialDelayWithoutJitter​(Duration baseDelay,
                                             Duration maxDelay)
    • Method Detail

      • computeDelay

        public Duration computeDelay​(int attempt)
        Description copied from interface: BackoffStrategy
        Compute the amount of time to wait before the provided attempt number is executed.
        Specified by:
        computeDelay in interface BackoffStrategy
        Parameters:
        attempt - The attempt to compute the delay for, starting at one.