Skip to content

Class: Dispatcher

Responsible for sending messages from a Source to an associated WorkerSource.

Methods

broadcast

broadcast<T>(type, data): Promise<RequestResponseMessageMap[T][1][]>

Broadcast a message to all Workers.

Type parameters

Name Type
T extends MessageType

Parameters

Name Type
type T
data RequestResponseMessageMap[T][0]

Returns

Promise<RequestResponseMessageMap[T][1][]>

Defined in

src/util/dispatcher.ts:38


getActor

getActor(): Actor

Acquires an actor to dispatch messages to. The actors are distributed in round-robin fashion.

Returns

Actor

An actor object backed by a web worker for processing messages.

Defined in

src/util/dispatcher.ts:50