newExponentialDecorrelatedJitter function

BackoffFactory newExponentialDecorrelatedJitter(
  1. Duration min,
  2. Duration max,
  3. double base,
  4. Random rng,
)

Creates a BackoffFactory with backoff of the roughly of the form base^x where x is the attempt number. Delays start at the minimum duration and after each attempt delay = rand(min, delay * base), bounded by the max See https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/ for more information

Implementation

BackoffFactory newExponentialDecorrelatedJitter(
    Duration min,
    Duration max,
    double base,
    Random rng) {
  return () => ExponentialDecorrelatedJitter(
    RandomizedBackoff(min, max, rng),
    base,
  );
}