Skip to content
English

MicrotaskDispatcher

Defined in: src/Dispatcher.ts:85

Runs work on the microtask queue. Fastest, but can starve I/O and timers under sustained actor load because microtasks always run before macrotasks.

new MicrotaskDispatcher(): MicrotaskDispatcher

MicrotaskDispatcher

readonly id: "microtask-dispatcher" = 'microtask-dispatcher'

Defined in: src/Dispatcher.ts:86

Dispatcher.id


optional onError?: DispatcherErrorSink

Defined in: src/Dispatcher.ts:87

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.

Dispatcher.onError

execute(task): void

Defined in: src/Dispatcher.ts:88

Schedule a unit of work to be executed asynchronously.

() => void | Promise<void>

void

Dispatcher.execute