Interface Jitter

All Superinterfaces:
Function<BackoffDelay,Duration>

public interface Jitter extends Function<BackoffDelay,Duration>
Jitter function that is applied to the backoff delay.
  • Field Details

    • NO_JITTER

      static final Jitter NO_JITTER
    • RANDOM_JITTER

      static final Jitter RANDOM_JITTER
  • Method Details

    • noJitter

      static Jitter noJitter()
      Jitter function that is a no-op.
      Returns:
      Jitter function that does not apply any jitter
    • random

      static Jitter random()
      Jitter function that applies a random jitter with a factor of 0.5, generating a backoff between [d - d*0.5; d + d*0.5] (but still within the limits of [BackoffDelay.minDelay(); BackoffDelay.maxDelay()].
      Returns:
      Jitter function to randomize backoff delay
    • random

      static Jitter random(double randomFactor)
      Jitter function that applies a random jitter with a provided [0; 1] factor (default 0.5), generating a backoff between [d - d*factor; d + d*factor] (but still within the limits of [BackoffDelay.minDelay(); BackoffDelay.maxDelay()].
      Returns:
      Jitter function to randomize backoff delay