LinearBackoff class
Linear backoff that increases delay by a fixed amount each attempt.
Example:
LinearBackoff(initial: Duration(seconds: 1), increment: Duration(seconds: 1))
// Delays: 1s, 2s, 3s, 4s, ...
- Implemented types
Constructors
- LinearBackoff({required Duration initial, required Duration increment, Duration? maxDelay})
-
Creates a linear backoff strategy.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- increment → Duration
-
Amount to add for each subsequent attempt.
final
- initial → Duration
-
Initial delay for the first retry.
final
- maxDelay → Duration?
-
Maximum delay cap (optional).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
delay(
int attempt) → Duration -
Calculates the delay before the next retry attempt.
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