RetryPolicy class

Retry policy for failed requests

Constructors

RetryPolicy({int maxAttempts = 3, int initialDelayMs = 1000, int maxDelayMs = 10000, double backoffMultiplier = 2.0, List<int> retryableStatusCodes = const [408, 429, 500, 502, 503, 504]})
Creates a new RetryPolicy
const

Properties

backoffMultiplier double
Backoff multiplier for exponential backoff
final
hashCode int
The hash code for this object.
no setterinherited
initialDelayMs int
Initial delay in milliseconds
final
maxAttempts int
Maximum number of retry attempts
final
maxDelayMs int
Maximum delay in milliseconds
final
retryableStatusCodes List<int>
HTTP status codes that should trigger a retry
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

execute<T>(Future<T> fn()) Future<T>
Executes a function with retry logic
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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