ExponentialBackoff class

Implements an exponential backoff retry strategy.

Implemented types

Constructors

ExponentialBackoff({Duration baseDelay = const Duration(seconds: 1), double multiplier = 2.0, Duration maxDelay = const Duration(minutes: 5)})
Creates an exponential backoff strategy.
const

Properties

baseDelay Duration
Initial delay before the first retry.
final
hashCode int
The hash code for this object.
no setterinherited
maxDelay Duration
The maximum delay cap to prevent excessively long waits.
final
multiplier double
The multiplier applied to each subsequent retry delay.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getDelay(int attemptNumber) Duration
Calculates the delay for a given retry attempt. Can return a Duration directly or a Future<Duration>.
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