Ir al contenido
Español

Dispatcher

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

Defined in: src/Dispatcher.ts:26

A Dispatcher schedules the execution of actor message-processing units. In a single-threaded JS runtime we pick between the microtask queue and setImmediate to balance throughput against fairness with I/O.

readonly id: string

Defined in: src/Dispatcher.ts:27


optional onError?: DispatcherErrorSink

Defined in: src/Dispatcher.ts:39

Where a unit of work that threw is reported. Optional so a third-party dispatcher stays a two-member implementation: an unset sink falls back to console.error, which is what every dispatcher did before the slot existed.

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

execute(task): void

Defined in: src/Dispatcher.ts:29

Schedule a unit of work to be executed asynchronously.

() => void | Promise<void>

void