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.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Scheduler():
Scheduler
Returns
Section titled “Returns”Scheduler
Properties
Section titled “Properties”onError?
Section titled “onError?”
optionalonError?: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.
Methods
Section titled “Methods”scheduleAtFixedRate()
Section titled “scheduleAtFixedRate()”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.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”initialDelayMs
Section titled “initialDelayMs”number
intervalMs
Section titled “intervalMs”number
target
Section titled “target”ActorRef<T>
message
Section titled “message”T
sender?
Section titled “sender?”ActorRef<unknown> | null
Returns
Section titled “Returns”scheduleAtFixedRateFunction()
Section titled “scheduleAtFixedRateFunction()”scheduleAtFixedRateFunction(
initialDelayMs,intervalMs,task):Cancellable
Defined in: src/Scheduler.ts:121
Parameters
Section titled “Parameters”initialDelayMs
Section titled “initialDelayMs”number
intervalMs
Section titled “intervalMs”number
() => void
Returns
Section titled “Returns”scheduleOnce()
Section titled “scheduleOnce()”scheduleOnce<
T>(delayMs,target,message,sender?):Cancellable
Defined in: src/Scheduler.ts:96
Deliver a message once after a delay.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”delayMs
Section titled “delayMs”number
target
Section titled “target”ActorRef<T>
message
Section titled “message”T
sender?
Section titled “sender?”ActorRef<unknown> | null
Returns
Section titled “Returns”scheduleOnceFunction()
Section titled “scheduleOnceFunction()”scheduleOnceFunction(
delayMs,task):Cancellable
Defined in: src/Scheduler.ts:106
Run a user-supplied function once after a delay.
Parameters
Section titled “Parameters”delayMs
Section titled “delayMs”number
() => void
