RetryPattern constructor

const RetryPattern({
  1. required Duration initialDelay,
  2. double backOff = 1.25,
  3. int maxBackOff = 10,
  4. bool jitter = false,
  5. int jitterMaxPercent = 30,
})

Implementation

const RetryPattern({
  required this.initialDelay,

  /// The amount to back off, every time a new retry is made, the next delay
  /// will be incremented by this amount as a percentage of the previous
  /// retry delay.
  ///
  /// So the first retry will be [initialDelay], the second retry will be
  /// first retry * [backOff], the third retry will be second retry *
  /// [backOff].
  this.backOff = 1.25,

  /// The maximum amount of times before we no longer back off any further
  /// and just continue using the last value for future retries.
  this.maxBackOff = 10,

  /// Applies "jitter" which is a random value that is added to each delay
  /// that can be used to off-set requests between multiple clients.
  this.jitter = false,

  /// The maximum bounds of this jitter, so setting it to a value of [30]
  /// will increment the delay anywhere between 0 and 30%.
  ///
  /// If [jitter] is false, this has no effect.
  this.jitterMaxPercent = 30,
});