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

TimerScheduler()

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 key is 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 message to the actor after delay.
startTimerAtFixedRate(String key, dynamic message, Duration interval) → void
Starts a periodic timer that sends message with fixed rate.
startTimerWithFixedDelay(String key, dynamic message, Duration delay) → void
Starts a periodic timer that sends message with fixed delay between executions.
toString() String
A string representation of this object.
inherited

Operators

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