delay method

  1. @override
Duration delay()
override

Calculates how long the next backoff duration should be, given the prior calls to delay

Implementation

@override
Duration delay() {
  final attempt = attemptBackoff.attempt;
  attemptBackoff.attempt++;

  final durationMicros = (pow(base, attempt) * timeUnits.inMicroseconds).round();
  return attemptBackoff.jitter(
    Duration(microseconds: durationMicros) + offset,
    attemptBackoff.min,
    attemptBackoff.max,
    attemptBackoff.rng
  );
}