jonnify·bcs /bcs/codemojex/guesses-on-fair-lanes/fair-lanes-and-the-worker

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.

Lanes served in rotation, one score worker, and a result broadcast or withheld by mode. Select a part.
PLR lanePLR lanePLR laneserved in rotationa starvation gate score workerthe host never scoresreads the cached secretand records the result live roombroadcast a scored eventblind roomsilent, the bank accrues
readout · Select a part. The bus serves the PLR lanes in rotation behind a starvation gate; one score worker reads the cached secret and records the result; a live room broadcasts at once, a blind room stays silent and the bank accrues.
§1

The idea

codemojex · fair lanes and the worker

Each 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.

§4

The doors

the sibling courses
§2

References

sources · related

Sources

Related