RetryHandler class
Handles automatic retries for retryable AI errors.
Uses exponential backoff with jitter to avoid thundering herd.
Constructors
- RetryHandler({int maxRetries = 3, Duration baseDelay = const Duration(seconds: 1), Duration maxDelay = const Duration(seconds: 30)})
Properties
- baseDelay → Duration
-
Base delay between retries.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxDelay → Duration
-
Maximum delay between retries.
final
- maxRetries → int
-
Maximum number of retry attempts.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
execute<
T> (Future< T> action()) → Future<T> -
Executes
actionwith automatic retries on retryable errors. -
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