FetchStrategyBuilder class
Builds common retry strategies: exponential backoff with optional jitter, bounded by attempt count, with a pluggable predicate for which HTTP status codes count as transient.
Constructors
- FetchStrategyBuilder({int maxTries = 3, Duration initialPause = const Duration(milliseconds: 100), double backOffFactor = 1.5, Duration maxPause = const Duration(minutes: 1), double jitter = 0.25, TransientHttpStatusCodePredicate transientHttpStatusCodePredicate = defaultTransientHttpStatusCodePredicate})
-
Creates a strategy builder.
const
Properties
- backOffFactor → double
-
Multiplier applied to the pause after each failed attempt.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialPause → Duration
-
Pause before the first retry.
final
- jitter → double
-
Relative random jitter applied to each pause (0 disables).
final
- maxPause → Duration
-
Upper bound for any single pause.
final
- maxTries → int
-
Maximum number of attempts before giving up.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- transientHttpStatusCodePredicate → TransientHttpStatusCodePredicate
-
Decides which HTTP status codes are retryable.
final
Methods
-
build(
) → FetchStrategy - Builds the FetchStrategy.
-
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