Expand description
Bidirectional WebSocket server for real-time shards.
Runs on its own port (typically pylon_port + 3). Each connection:
- Parses the request path for
?shard=<id>&sid=<subscriber>. - Looks up the shard in the
DynShardRegistry. - Runs the subscribe authorization hook.
- Registers a [
SnapshotSink] that writes binary frames to the socket. - Reads text/binary frames from the client and pushes them as inputs.
- Cleans up on disconnect.
Each client gets its own dedicated thread. For larger deployments, swap in an async runtime; for pylon’s current scale, thread-per-conn is simpler and fine.
Functions§
- start_
shard_ ws_ server - Run a WebSocket server that accepts shard connections.