RefreshRetryConfig.exponential constructor

RefreshRetryConfig.exponential({
  1. int maxAttempts = 3,
  2. Duration delay = const Duration(milliseconds: 200),
  3. Duration? maxDelay = const Duration(seconds: 5),
  4. double backoffFactor = 2.0,
  5. double jitter = 0.2,
  6. Duration? attemptTimeout,
})

Convenience: exponential backoff for transient (isRetryable) failures.

Implementation

factory RefreshRetryConfig.exponential({
  int maxAttempts = 3,
  Duration delay = const Duration(milliseconds: 200),
  Duration? maxDelay = const Duration(seconds: 5),
  double backoffFactor = 2.0,
  double jitter = 0.2,
  Duration? attemptTimeout,
}) {
  return RefreshRetryConfig(
    maxAttempts: maxAttempts,
    delay: delay,
    maxDelay: maxDelay,
    backoffFactor: backoffFactor,
    jitter: jitter,
    attemptTimeout: attemptTimeout,
  );
}