ReconnectPolicy class

Exponential backoff with jitter for reconnection.

Constructors

ReconnectPolicy({Duration initial = const Duration(milliseconds: 500), Duration max = const Duration(seconds: 30), double factor = 2.0, Random? random})
Creates a reconnect policy. Pass a seeded random for deterministic jitter in tests.

Properties

factor double
The exponential growth factor.
final
hashCode int
The hash code for this object.
no setterinherited
initial Duration
The initial delay.
final
max Duration
The maximum delay.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

nextDelay() Duration
The next backoff delay, advancing the attempt counter.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset() → void
Resets the backoff after a successful connection.
toString() String
A string representation of this object.
inherited

Operators

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