RetryConfig constructor

const RetryConfig({
  1. int maxAttempts = 3,
  2. Duration delay = const Duration(seconds: 1),
  3. Duration maxDelay = const Duration(seconds: 30),
  4. double backoffMultiplier = 2.0,
  5. bool useJitter = true,
})

Creates a retry policy.

Implementation

const RetryConfig({
  this.maxAttempts = 3,
  this.delay = const Duration(seconds: 1),
  this.maxDelay = const Duration(seconds: 30),
  this.backoffMultiplier = 2.0,
  this.useJitter = true,
})  : assert(maxAttempts >= 0, 'maxAttempts must be non-negative'),
      assert(backoffMultiplier >= 1.0, 'backoffMultiplier must be >= 1.0');