RefreshRetryConfig constructor

const RefreshRetryConfig({
  1. int maxAttempts = 1,
  2. Duration delay = const Duration(milliseconds: 500),
  3. Duration? maxDelay,
  4. double backoffFactor = 2.0,
  5. double jitter = 0.0,
  6. Duration? attemptTimeout,
  7. Random? random,
  8. bool retryIf(
    1. Failure failure
    )?,
})

Creates a config. With the defaults the refresh is attempted once and no retries are made (matches the spec of token_keeper 1.0.x).

Implementation

const RefreshRetryConfig({
  this.maxAttempts = 1,
  this.delay = const Duration(milliseconds: 500),
  this.maxDelay,
  this.backoffFactor = 2.0,
  this.jitter = 0.0,
  this.attemptTimeout,
  this.random,
  this.retryIf,
})  : assert(maxAttempts > 0, 'maxAttempts must be > 0'),
      assert(backoffFactor > 0, 'backoffFactor must be > 0'),
      assert(jitter >= 0, 'jitter must be >= 0');