RetrySimple class
Simple retry policy: retry up to a maximum number of attempts with no delay
Example:
final limit = fLimit(2);
await limit(
() => fetchData(),
retry: RetrySimple(maxAttempts: 3),
);
- Inheritance
-
- Object
- RetryPolicy
- RetrySimple
Constructors
- RetrySimple({required int maxAttempts})
- Creates a simple retry policy
Properties
- 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