Module peer

Module peer 

Source
Expand description

What the voice plane needs to reach one connection, and how it finds it.

This is the guide’s Bindings table (9.7). A datagram arrives with nothing but a source address, and everything needed to answer it has to be reachable from that address alone: the OCB2 domain, the shard’s routing table, the cursor to gate on, and a queue for the TCP fallback.

§Locks

There are several, and none of them is on a hot path in the sense that matters. Each Peer owns its own Mutex, so two connections never contend with each other; the registry’s RwLocks are read once per datagram and written once per connection lifetime. No guard here is ever held across an .await: every method returns before its caller can suspend.

The one lock that would be a design error is a shared lock over live state on the packet path. There is none: the routing table is an Arc that the shard replaces whole, and reading it copies a pointer.

Structs§

ClientReport
What a client last told us about the connection, in its own Ping.
Peer
One connection, as the voice plane sees it.
Peers
Every live connection, indexed the four ways the runtime needs.
ShardPlane
Which shard a connection currently belongs to, and where its routes come from.