TimerScheduler class abstract
A scheduler for managing timers within an actor.
TimerScheduler provides methods to schedule messages to be sent to an actor at specific times or intervals. Timers are bound to the actor's lifecycle and are automatically cancelled when the actor is stopped or restarted.
Each timer is identified by a key, and starting a new timer with an existing key will cancel the previous timer with that key.
Constructors
Properties
-
activeTimers
→ List<
String> -
Returns a list of all active timer keys.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
cancel(
String key) → void -
Cancels the timer with the given
key. -
cancelAll(
) → void - Cancels all active timers for this actor.
-
isTimerActive(
String key) → bool -
Returns true if a timer with the given
keyis currently active. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
startSingleTimer(
String key, dynamic message, Duration delay) → void -
Starts a single-shot timer that sends
messageto the actor afterdelay. -
startTimerAtFixedRate(
String key, dynamic message, Duration interval) → void -
Starts a periodic timer that sends
messagewith fixed rate. -
startTimerWithFixedDelay(
String key, dynamic message, Duration delay) → void -
Starts a periodic timer that sends
messagewith fixed delay between executions. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited