RetryPolicy class
Immutable exponential-backoff-with-jitter configuration — no timers, no randomness of its own, just the math. RetryExecutor is what actually runs a retry loop against it.
Constructors
Properties
- baseDelay → Duration
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- jitterFraction → double
-
Fraction of the (pre-jitter) delay randomized in either direction —
0.2means the actual delay lands within ±20% of the exponential value, capped to maxDelay either way.final - maxAttempts → int
-
final
- maxDelay → Duration
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- timeout → Duration?
-
Per-attempt timeout —
nullmeans an attempt can run indefinitely.final
Methods
-
delayBeforeAttempt(
int attemptNumber, double randomValue) → Duration -
Delay before attempt
attemptNumber(1-indexed — attempt 1 is the first try, so it's always Duration.zero).randomValuemust be in[0, 1]; callers needing determinism (tests, or RetryExecutor's own injectedrandomFn) supply it directly instead of this class reaching fordart:math'sRandomitself. -
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