Nexus API Reference

TimerScheduler

Tags
psalm-api

Keyed timer management for actors.

Starting a timer with a key that already exists auto-cancels the previous timer. All timers are automatically cancelled when the actor stops.

Table of Contents

Methods

cancel()  : void
cancelAll()  : void
isTimerActive()  : bool
startSingleTimer()  : void
Start a single-fire timer. If a timer with this key already exists, it is cancelled first.
startTimerAtFixedRate()  : void
Start a repeating timer at a fixed rate (drift-compensating).
startTimerWithFixedDelay()  : void
Start a repeating timer with a fixed delay between completions.

Methods

cancel()

public cancel(string $key) : void
Parameters
$key : string

isTimerActive()

public isTimerActive(string $key) : bool
Parameters
$key : string
Return values
bool

startSingleTimer()

Start a single-fire timer. If a timer with this key already exists, it is cancelled first.

public startSingleTimer(string $key, object $message, Duration $delay) : void
Parameters
$key : string
$message : object
$delay : Duration

startTimerAtFixedRate()

Start a repeating timer at a fixed rate (drift-compensating).

public startTimerAtFixedRate(string $key, object $message, Duration $interval[, Duration|null $initialDelay = null ]) : void

If a timer with this key already exists, it is cancelled first.

Parameters
$key : string
$message : object
$interval : Duration
$initialDelay : Duration|null = null

startTimerWithFixedDelay()

Start a repeating timer with a fixed delay between completions.

public startTimerWithFixedDelay(string $key, object $message, Duration $delay[, Duration|null $initialDelay = null ]) : void

If a timer with this key already exists, it is cancelled first.

Parameters
$key : string
$message : object
$delay : Duration
$initialDelay : Duration|null = null

        
On this page

Search results