newPolynomialBackoff function

BackoffFactory newPolynomialBackoff(
  1. Duration min,
  2. Duration max,
  3. Jitter jitter,
  4. Duration timeUnits,
  5. List<double> polyCoefs,
  6. Random rng,
)

Creates a BackoffFactory with backoff of the form c0x^0, c1x^1, ...cn*x^n where x is the attempt number jitter is the function for adding randomness around the backoff timeUnits are the units of time the polynomial is evaluated in polyCoefs is the array of polynomial coefficients from c0, c1, ... cn

Implementation

BackoffFactory newPolynomialBackoff(
    Duration min,
    Duration max,
    Jitter jitter,
    Duration timeUnits,
    List<double> polyCoefs,
    Random rng) {
  return () => PolynomialBackoff(
    AttemptBackoff(min, max, jitter, rng),
    timeUnits,
    polyCoefs,
  );
}