B7.3.3 · dive 3 of 3 · module B7.3
Fair lanes and the worker.
The bus serves the PLR lanes in rotation behind a starvation gate; the host never scores, one worker reads the cached secret and records the result, and a live room broadcasts while a blind room stays silent.
The idea
codemojex · fair lanes and the workerEach player has a lane, named by their PLR id, and the bus serves the lanes in rotation rather than draining one to the bottom. A starvation gate keeps a single hot player from monopolizing the worker: the rotation moves on, so a quiet player’s guess is scored in turn. The lanes are the partitioning, and the branded id is what routes a guess to its lane.
The host that accepts a guess never scores it. One consumer — the reference implementation calls it the score worker — pulls the next job, reads the secret from the cache under the game’s version, computes the result, and writes it down. Separating the accepting side from the scoring side is what lets the secret stay on one side of the boundary and the player’s request return without it.
What happens after scoring is where the modes diverge. A live room broadcasts a scored event on the channel, and the player sees their result and the leaderboard move at once. A blind room stays silent: the score is recorded, the bank accrues, and nothing returns to the player until the settlement at the close. The same lane and the same worker drive both; the policy on the room decides whether a result is published or withheld.
The doors
the sibling coursesEchoMQ — the protocol, in depth
The bus B3 narrates, taught rung by rung: the keyspace, the Lua inventory, and the 3.0 Stream Tier — XADD, XREADGROUP, XACK — with conformance on Valkey.
Redis Patterns Applied
The substrate patterns under the bus: sorted sets, atomic Lua moves, locks, and streams — the judgement layer.
/echo-persistenceEcho Persistence — the durable floor
Beneath the volatile tiers: the Graft page engine built twice, the commit-LSN loop, and the stream archive on Tigris. Where Part I says state lives somewhere, this says where it lives durably.
References
sources · relatedSources
- Kreps — The Log: real-time data’s unifying abstractionthe lane as an append-only log a single consumer drains in order
- The Go Blog — Share Memory By Communicatingthe worker consuming a job by message, holding no shared state
- Erlang/OTP — the gen_server behaviourthe validator and the score worker as processes behind a boundary
Related
- BCS — the course homethe law, the id anatomy, the chapter map
- Echo Persistencethe durable floor beneath the bus