SocketRunner
Runs cluster runner RPCs over a socket transport.
The full layer serves runner RPC handlers on a provided SocketServer, logs the bound address, and provides Sharding and Runners clients when an outgoing runner client protocol is available. This module also includes a client-only socket runner layer for processes that need cluster clients without starting a runner server or receiving shard assignments.
Layers
Signature
declare const layer: Layer.Layer<
Sharding.Sharding | Runners.Runners,
never,
| Runners.RpcClientProtocol
| ShardingConfig
| RpcSerialization.RpcSerialization
| SocketServer
| MessageStorage
| RunnerStorage.RunnerStorage
| RunnerHealth
>;layerClientOnly
Added in v4.0.0
Source
Provides a client-only socket runner layer that provides Sharding and Runners clients without starting a runner server or receiving shard assignments.
When to use
Use to join a socket-based cluster as a client-only participant that can send messages without hosting shards.
Signature
declare const layerClientOnly: Layer.Layer<
Sharding.Sharding | Runners.Runners,
never,
Runners.RpcClientProtocol | ShardingConfig | MessageStorage | RunnerStorage.RunnerStorage
>;
Layer that runs a cluster runner over the socket RPC protocol, providing
ShardingandRunnersclients and logging the socket listen address.When to use
Use when a cluster runner process should accept runner RPCs through a provided
SocketServerand receive shard assignments while exposingShardingandRunnersservices.Details
It logs the bound
SocketServer.addresswhen the layer starts, formatting TCP addresses ashostname:portand Unix socket addresses as their filesystem path.Gotchas
Although this layer serves runner RPCs with the provided
SocketServer, outgoing calls to other runners still require aRunners.RpcClientProtocolservice.See
layerClientOnlyfor the socket runner layer that only provides clients and does not receive shard assignmentsRunners.RpcClientProtocol for the outgoing runner client protocol required by this layer