KletsoBackoff class final
Exponential backoff with full jitter: each delay is uniform in
[0, min(cap, base * 2^attempt)].
Constructors
- KletsoBackoff({required Duration base, required Duration cap, Random? random})
-
Creates a policy; pass a seeded
randomin tests.
Properties
- attempt → int
-
Attempts since the last reset.
no setter
- base → Duration
-
Delay ceiling for attempt 0.
final
- cap → Duration
-
Never wait longer than this.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- nextCeiling → Duration
-
Upper bound of the next delay without consuming an attempt.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
next(
) → Duration - Returns the next delay and advances the attempt counter.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reset(
) → void - Starts over after a successful connection.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited