RetryPolicy class

Reusable retry helper with backoff strategy. Returns null if all retries fail or operation is cancelled.

Constructors

RetryPolicy({required BackoffStrategy backoff, int maxRetries = 3})

Properties

backoff BackoffStrategy
final
hashCode int
The hash code for this object.
no setterinherited
maxRetries int
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

attempt<T>(Future<T> operation(), {bool isCancelled()?}) Future<T?>
Attempt operation with retries and backoff. isCancelled optional callback to check for cancellation.
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