Debounce class

Represents a capped exponential back-off in milliseconds with jittering.

The jittered back-off is always between half of the maximum possible timeout for the current number of failed tries and the maximum possible timeout.

It is possible for the debounce value to overflow. Debounce handles on integer overflows on a best-effort basis.

Constructors

Debounce({required int initial, required int cap})
Creates a Debounce with the given initial value and cap. Both the initial value and cap should be milliseconds greater than 0.

Properties

cap int
The capped duration that
final
hashCode int
The hash code for this object.
no setterinherited
initial int
The initial value.
final
pending bool
Returns whether this Debounce is still pending.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timeout int
Returns the maximum possible timeout (in milliseconds) for the current number of failed tries.
no setter
tries int
Returns the number of failed tries.
no setter

Methods

clear() → void
Clears this Debounce.
debounce() → void
Signals that all future operations until a certain time should be cancelled.
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