ExponentialBackoff class

Exponential backoff with jitter: base * 2^attempt, capped at maxDelay. The default mirrors the JS SDK (exponentialBackoff).

Inheritance

Constructors

ExponentialBackoff({int maxAttempts = 3, Duration baseDelay = const Duration(milliseconds: 500), Duration maxDelay = const Duration(seconds: 30), double jitterFactor = 0.2})
Build an exponential backoff policy.
const

Properties

baseDelay Duration
Initial delay used for the first retry.
final
hashCode int
The hash code for this object.
no setterinherited
jitterFactor double
Fraction of the raw delay added/removed as jitter.
final
maxAttempts int
Maximum number of retry attempts (excluding the initial call).
final
maxDelay Duration
Hard upper bound on the computed delay.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

next(int attempt, RetryContext ctx) RetryDecision
Decide what to do after the attemptth failure (0-indexed).
override
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