Skip to content

Dispatcher

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

Methods

broadcast()

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

Broadcast a message to all Workers.

Type Parameters

Type Parameter
T extends MessageType

Parameters

Parameter 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