BackOff<T> constructor

const BackOff<T>(
  1. FutureOr<T> func(), {
  2. Duration delayFactor = const Duration(milliseconds: 200),
  3. double randomizationFactor = 0.25,
  4. Duration maxDelay = const Duration(seconds: 30),
  5. int maxAttempts = 8,
  6. FutureOr<bool> retryIf(
    1. Object error,
    2. int attempt
    )?,
})

Implementation

const BackOff(
  this.func, {
  this.delayFactor = const Duration(milliseconds: 200),
  this.randomizationFactor = 0.25,
  this.maxDelay = const Duration(seconds: 30),
  this.maxAttempts = 8,
  this.retryIf,
}) : assert(maxAttempts >= 1, 'maxAttempts must be greater than 0');