Dispatcher
Defined in: util/dispatcher.ts:12
Responsible for sending messages from a Source to an associated worker source (usually with the same name).
Methods
broadcast()
broadcast<
T>(type:T,data:RequestResponseMessageMap[T][0]):Promise<RequestResponseMessageMap[T][1][]>
Defined in: util/dispatcher.ts:44
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][]>
getActor()
getActor():
Promise<Actor>
Defined in: util/dispatcher.ts:53
Acquires an actor to dispatch messages to. The actors are distributed in round-robin fashion.
Returns
Promise<Actor>
An actor object backed by a web worker for processing messages.