RetryOptions class

Object holding options for retrying a function.

Constructors

RetryOptions({Duration retryJitter = const Duration(milliseconds: 0), Duration maxDelay = const Duration(seconds: 125), Duration maxTime = const Duration(seconds: 180), Duration retryInterval = const Duration(seconds: 5), int maxRetries = 5, int exponentialBase = 2})
Create a set of RetryOptions.
const

Properties

exponentialBase int
Exponential base
final
hashCode int
The hash code for this object.
no setterinherited
maxDelay Duration
Maximum delay between retries
final
maxRetries int
Maximum number of attempts before giving up, defaults to 5.
final
maxTime Duration
Maximum retry time
final
retryInterval Duration
First retry interval
final
retryJitter Duration
Include random milliseconds when retrying HTTP calls
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

delay(int attempt, int? retryAfter, DateTime? deadline) Duration
Delay after attempt number of attempts.
isRetryable(Exception e) Future<bool>
Checks if the exception is retryable
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
retry<T>(FutureOr<T> fn(), {FutureOr<bool> retryIf(Exception)?, FutureOr<void> onRetry(Exception)?}) Future<T>
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited