Skip to main content

Module slot

Module slot 

Source
Expand description

Per-replica slot bookkeeping for the primary’s streaming loop.

Each connected (or recently-disconnected) replica owns one ReplicaSlot. The SlotTable is the source of truth for “who still has a chance to resume from the backlog vs whom we have given up on”. Slots are pure data; socket lifetime and the streaming loop’s wakeups live in the wiring layer.

Clock policy: all timestamps are u64 monotonic nanoseconds supplied by the caller. The module never reads the clock itself — tests pump synthetic timestamps, and the production hook uses a single Instant-derived u64. Same pattern as the cached-clock work in kevy-store.

Structs§

ReplicaSlot
One connected-or-recently-disconnected replica.
SlotTable
Mutable collection of ReplicaSlots. Slots are addressed by id; duplicate insertion upserts (newer state wins). Replica counts in realistic deployments are small (< 16); a linear Vec is faster than a HashMap at this size and avoids the cost of the hasher the rest of the workspace uses.