Throttle class final
Limits the execution rate of a function.
Once an action is run, subsequent calls are ignored for the specified duration (the "cool-down" period).
Constructors
- Throttle.new(Duration duration)
-
Creates a throttle with a specific cool-down
duration
.
Properties
- duration → Duration
-
The cool-down period after an action is executed.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isThrottled → bool
-
Returns
true
if the throttle is currently in its cool-down period.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
run(
void action()) → void -
Executes the
action
if the throttle is not currently active. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited