BroadcastChannelTransport
Defined in: packages/sharding/src/transport.ts:17
One process: shards in the same process (or worker threads of it) talk over a BroadcastChannel.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new BroadcastChannelTransport(
name):BroadcastChannelTransport
Defined in: packages/sharding/src/transport.ts:20
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”BroadcastChannelTransport
Methods
Section titled “Methods”close()
Section titled “close()”close():
void
Defined in: packages/sharding/src/transport.ts:34
Stops listening and releases the channel.
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”onMessage()
Section titled “onMessage()”onMessage(
listener):void
Defined in: packages/sharding/src/transport.ts:28
Listens for messages from other shards.
Parameters
Section titled “Parameters”listener
Section titled “listener”(message) => void
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”post()
Section titled “post()”post(
message):void
Defined in: packages/sharding/src/transport.ts:24
Sends a message to the other shards. Delivery to the sender itself is not required.
Parameters
Section titled “Parameters”message
Section titled “message”Returns
Section titled “Returns”void