IpcTransport
Defined in: packages/sharding/src/transport.ts:59
Carries ShardMessages between the processes or threads that run shards.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new IpcTransport(
endpoint?):IpcTransport
Defined in: packages/sharding/src/transport.ts:65
Parameters
Section titled “Parameters”endpoint?
Section titled “endpoint?”IpcEndpoint = ...
Returns
Section titled “Returns”IpcTransport
Methods
Section titled “Methods”close()
Section titled “close()”close():
void
Defined in: packages/sharding/src/transport.ts:108
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:100
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”onPeerDown()
Section titled “onPeerDown()”onPeerDown(
listener):void
Defined in: packages/sharding/src/transport.ts:104
Listens for the shards of a cluster that died, so pending requests to them can fail early.
Parameters
Section titled “Parameters”listener
Section titled “listener”(shardIds) => 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:91
Sends to the parent, which relays to other clusters, and delivers to the other buses in this process: the parent never sends a message back to the cluster it came from, so without this a shard could not reach a shard in its own worker. Each bus drops what is not addressed to it.
Parameters
Section titled “Parameters”message
Section titled “message”Returns
Section titled “Returns”void