ExponentialBackoffRetryPolicy class

Implemented types

Constructors

ExponentialBackoffRetryPolicy({int maxAttempts = 5, Duration baseDelay = const Duration(seconds: 1), double factor = 2, Duration maxDelay = const Duration(seconds: 30), Duration jitter = const Duration(milliseconds: 100), Random? random})
Creates the policy.

Properties

baseDelay Duration
Base delay (the first retry waits this long). Default 1s.
final
factor double
Multiplicative factor. Default 2 (so delays grow as 1s, 2s, 4s, 8s, 16s).
final
hashCode int
The hash code for this object.
no setterinherited
jitter Duration
Jitter range (a random offset in [-jitter, +jitter] is added to each delay). Default 100ms.
final
maxAttempts int
Total attempts (including the first). Default 5.
final
maxDelay Duration
Cap on the delay. Default 30s.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
shouldRetry({required int attempt, required Object error, required StackTrace stackTrace}) RetryDecision
Decide whether to retry after attempt failures.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited