RetryOptions constructor

const RetryOptions({
  1. Duration delayFactor = const Duration(milliseconds: 200),
  2. double randomizationFactor = 0.25,
  3. Duration maxDelay = const Duration(seconds: 30),
  4. int maxAttempts = 8,
})

Create a set of RetryOptions.

Defaults to 8 attempts, sleeping as following after 1st, 2nd, 3rd, ..., 7th attempt:

  1. 400 ms +/- 25%
  2. 800 ms +/- 25%
  3. 1600 ms +/- 25%
  4. 3200 ms +/- 25%
  5. 6400 ms +/- 25%
  6. 12800 ms +/- 25%
  7. 25600 ms +/- 25%

Implementation

const RetryOptions({
  this.delayFactor = const Duration(milliseconds: 200),
  this.randomizationFactor = 0.25,
  this.maxDelay = const Duration(seconds: 30),
  this.maxAttempts = 8,
});