Ir al contenido
Español

Scheduler

Esta página aún no está disponible en tu idioma.

Defined in: src/Scheduler.ts:68

Time-based scheduler — a thin wrapper over setTimeout / setInterval, accurate enough for typical use and good enough for tests. Inject a ManualScheduler from the TestKit when you want fully deterministic time advancement.

new Scheduler(): Scheduler

Scheduler

optional onError?: SchedulerErrorSink

Defined in: src/Scheduler.ts:82

Where a scheduled task that threw is reported. Optional so that a scheduler stays usable with no system at all — a bare new Scheduler() in a test, or one constructed before ActorSystem.create returns — and an unset sink falls back to console.error, which is what every scheduler did before the slot existed.

ActorSystem fills it in with ??=, so a sink the owner set deliberately survives being handed to a system through ActorSystemOptions.withScheduler.

scheduleAtFixedRate<T>(initialDelayMs, intervalMs, target, message, sender?): Cancellable

Defined in: src/Scheduler.ts:111

Deliver a message repeatedly at a fixed interval, after an initial delay.

T

number

number

ActorRef<T>

T

ActorRef<unknown> | null

Cancellable


scheduleAtFixedRateFunction(initialDelayMs, intervalMs, task): Cancellable

Defined in: src/Scheduler.ts:121

number

number

() => void

Cancellable


scheduleOnce<T>(delayMs, target, message, sender?): Cancellable

Defined in: src/Scheduler.ts:96

Deliver a message once after a delay.

T

number

ActorRef<T>

T

ActorRef<unknown> | null

Cancellable


scheduleOnceFunction(delayMs, task): Cancellable

Defined in: src/Scheduler.ts:106

Run a user-supplied function once after a delay.

number

() => void

Cancellable