Skip to content

IpcTransport

Defined in: packages/sharding/src/transport.ts:59

Carries ShardMessages between the processes or threads that run shards.

new IpcTransport(endpoint?): IpcTransport

Defined in: packages/sharding/src/transport.ts:65

IpcEndpoint = ...

IpcTransport

close(): void

Defined in: packages/sharding/src/transport.ts:108

Stops listening and releases the channel.

void

ShardBusTransport.close


onMessage(listener): void

Defined in: packages/sharding/src/transport.ts:100

Listens for messages from other shards.

(message) => void

void

ShardBusTransport.onMessage


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.

(shardIds) => void

void

ShardBusTransport.onPeerDown


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.

ShardMessage

void

ShardBusTransport.post