Class Dispatcher
Index
Constructors
Properties
Methods
Constructors
constructor
Parameters
- workerPool: WorkerPool
- mapId: string | number
Returns Dispatcher
Methods
broadcast
- broadcast<T extends MessageType>(
type: T,
data: RequestResponseMessageMap[T][0],
): Promise<RequestResponseMessageMap[T][1][]>Broadcast a message to all Workers.
Type Parameters
- T extends MessageType
Parameters
- type: T
- data: RequestResponseMessageMap[T][0]
Returns Promise<RequestResponseMessageMap[T][1][]>
getActor
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.
registerMessageHandler
remove
Parameters
OptionalmapRemoved: boolean
Returns void
unregisterMessageHandler
Was this helpful?
Responsible for sending messages from a Source to an associated worker source (usually with the same name).