RetryFixed class

Fixed delay retry policy: retry with a constant delay between attempts

Example:

final limit = fLimit(2);

await limit(
  () => fetchData(),
  retry: RetryFixed(
    maxAttempts: 3,
    delay: Duration(seconds: 2),
  ),
);
Inheritance

Constructors

RetryFixed({required int maxAttempts, required Duration delay})
Creates a fixed delay retry policy

Properties

delay → Duration
Fixed delay between retry attempts
final
hashCode → int
The hash code for this object.
no setterinherited
maxAttempts → int
Maximum number of attempts (including the initial attempt)
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

nextDelay(int attempt, Object error, StackTrace stackTrace) → Duration?
Returns the delay before the next retry, or null for immediate retry
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
shouldRetry(int attempt, Object error, StackTrace stackTrace) → bool
Whether the task should be retried
override
toString() → String
A string representation of this object.
inherited

Operators

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