ExponentialBackoffStrategy class

Exponential backoff reconnection strategy.

Implemented types

Constructors

ExponentialBackoffStrategy.new({Duration initialDelay = const Duration(seconds: 1), Duration maxDelay = const Duration(minutes: 5), double multiplier = 2.0, double randomizationFactor = 0.1})
Creates a new ExponentialBackoffStrategy.

Properties

hashCode int
The hash code for this object.
no setterinherited
initialDelay Duration
Initial delay before first reconnection attempt.
final
maxDelay Duration
Maximum delay between reconnection attempts.
final
multiplier double
Multiplier for exponential backoff.
final
randomizationFactor double
Randomization factor to prevent thundering herd.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

calculateDelay(int attemptNumber) Duration
Calculates the delay before the next reconnection attempt.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset() → void
Resets the strategy state.
override
shouldReconnect(int attemptNumber, int maxAttempts) bool
Determines if reconnection should be attempted.
override
toString() String
A string representation of this object.
override

Operators

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