Throttler class
A lightweight throttler for rate-limiting actions over time.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- interval → Duration
-
Minimum delay between executions.
final
- isDisposed → bool
-
Returns
trueif the throttler has been disposed.no setter - isThrottled → bool
-
Returns
trueif throttling is currently active.no setter - leading → bool
-
Whether to execute immediately on the first call in a burst.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- trailing → bool
-
Whether to execute once at the end of a throttling window.
final
Methods
-
cancel(
) → void - Cancels any pending action and clears the current throttle window.
-
dispose(
) → void - Disposes the throttler and releases timers.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
run(
ThrottlerAction action) → void -
Runs
actionunder the current throttling rules. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited