FixedDelayRetry class

Simple fixed-delay retry policy. All retries wait delay milliseconds.

Inheritance

Constructors

FixedDelayRetry({int maxAttempts = 3, Duration delay = const Duration(seconds: 1), List<int> retryOnStatusCodes = RetryPolicy.defaultRetryStatusCodes})
const

Properties

delay Duration
final
hashCode int
The hash code for this object.
no setterinherited
maxAttempts int
Total number of attempts. 1 = try once, no retry.
final
retryOnStatusCodes List<int>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

delayFor(int attempt) Duration
Returns the delay to wait before attempt number attempt. attempt is 1-based: value for the next attempt.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
shouldRetry(int attempt, int? statusCode, Object? error) bool
Returns true if another attempt should be made after attempt attempt failed with the given statusCode or error.
override
toString() String
A string representation of this object.
inherited

Operators

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