Skip to content

@oona/vlo / host / Dispatcher

Class: Dispatcher ​

Defined in: sdk/ts/sdk/src/host/dispatcher.ts:102

The outbox dispatcher. createHost builds one per host holding the orchestrator role; only tests and custom hosts construct it directly.

Constructors ​

Constructor ​

new Dispatcher(ctx, options?): Dispatcher

Defined in: sdk/ts/sdk/src/host/dispatcher.ts:124

Reads the options once; nothing runs until Dispatcher.start.

Parameters ​

ctx ​

HostContext

options? ​

DispatcherOptions = {}

Returns ​

Dispatcher

Methods ​

kick() ​

kick(): void

Defined in: sdk/ts/sdk/src/host/dispatcher.ts:170

Runs a tick soon. Safe to call from inside a tick: it queues one more pass.

Returns ​

void


start() ​

start(): void

Defined in: sdk/ts/sdk/src/host/dispatcher.ts:147

Begins ticking (loop mode) or merely arms tick() (manual mode). Idempotent.

Returns ​

void


stop() ​

stop(): Promise<void>

Defined in: sdk/ts/sdk/src/host/dispatcher.ts:161

Stops ticking and waits for every pass still in flight. The wait is what makes shutdown safe: the host closes the journal next, and a stage halfway through a claim must not be left reading a connection that is gone.

Returns ​

Promise<void>


tick() ​

tick(): Promise<TickCounts>

Defined in: sdk/ts/sdk/src/host/dispatcher.ts:176

One pass over every stage. The tick route and the tests drive the outbox with it.

Returns ​

Promise<TickCounts>