RetryPolicy class
Evaluates and handles request retry logic for transient failures.
Constructors
-
RetryPolicy({int retryCount = 0, Duration retryDelay = const Duration(seconds: 1), List<
HttpMethod> retryOnMethods = const [HttpMethod.get, HttpMethod.head, HttpMethod.options]}) -
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- retryCount → int
-
final
- retryDelay → Duration
-
final
-
retryOnMethods
→ List<
HttpMethod> -
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
getDelay(
int attemptNumber) → Duration - Calculates delay before next retry attempt (with linear or exponential delay).
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
shouldRetry(
{required ApiError error, required int attemptNumber, required HttpMethod method}) → bool - Evaluates whether an error condition qualifies for retry.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited