jonnify·bcs /bcs/bus

B3 · The Bus — manuscript Part III

The law, set in motion.

Part I gave every row a name and Part II gave the names a home; Part III puts them in motion. EchoMQ 2.0 is the manuscript's bus — built Valkey-native from the first byte: a fresh emq: keyspace, a version-fenced Lua bundle negotiated before any command runs, and no compatibility ballast from any predecessor wire.

The cargo law is the series' oldest — only identities cross. A job names the entities it concerns; it never carries their rows, and everything the queue does moves fourteen-byte names whose bytes are already chronology. Each module below teaches one written chapter, its committed rung quoted verbatim on the page.

The Part III arc — seven modules in reading order. Select a node to read its thesis.
3.1 keyspace 3.2 jobs 3.3 machine 3.4 lanes 3.5 stores 3.6 referee 3.7 connector
readout · Select a chapter to read its thesis. Reading order runs left to right; B3.1 lands the connector substrate as the part's vocabulary.
§1

The seven modules

content/bcs3.1.md – bcs3.6.md, bcsA.md
B3.1

The Fence and the Keyspace

The connector substrate as the part's vocabulary: the emq:{q}:<type> grammar, the braced {emq}: base reserved for deployment facts, the boot fence as queue-grade gating, and the co-location law. The rung reads PASS 5/5.

3 divesbuilt
B3.2

Jobs Are Entities

The JOB kind registered under the D-8 bar; the three-field row, state / attempts / payload and nothing more; enqueue as one idempotent script; the order theorem's browse dividend. The rung reads PASS 5/5.

3 divesbuilt
B3.3

The State Machine in Lua

Claim, complete, retry, and dead-letter, every transition a single script. The server clock owns leases; attempts is the fencing token; the morgue keeps the last error and the reaper runs on the clock. The rung reads PASS 6/6.

3 divesbuilt
B3.4

Fair Lanes

Per-group lanes and a ring that holds exactly the serviceable ones; the rotating claim; ceilings and pauses; park-don't-poll on a wake key. Rotation is the refusal, with starvation gated, not promised. The rung reads PASS 8/8.

3 divessoon
B3.5

The Bus Meets the Stores

Commands out of entities, results back into properties, ids the only cargo. A row that records the names it has absorbed turns at-least-once delivery into exactly-once effect; the consumer is one more owner in the Part II tree. The rung reads PASS 6/6.

3 divessoon
B3.6

Conformance and the Rival's Numbers

Fourteen wire-level contracts a port drives verbatim, the referee habit, and Oban 2.18.3 on PostgreSQL 16.14 measured with the asymmetry stated first. The rung reads PASS 6/6, and CONFORMANCE 14/14.

3 divessoon
B3.7

Appendix A — The Connector

The substrate the part stands on: one-pass RESP2, pipelining as the primitive, the typed fatal fence, EVALSHA-first declared-keys scripts, and the measured wire. The gate reads PASS 8/8 against live Valkey.

3 divessoon

A module card becomes a link when its pages ship; the dives per module are fixed in the chapter spec, and the reading order is the arc above. Part III is fully written — all seven modules are buildable, with a frozen rung behind each.

§2

The laws of the part

content/bcs3.md

Part III states six laws and holds every chapter to them. They are the manuscript's, named here so the modules below read as applications of a rule rather than a list of features.

LAW 1

One transition, one script

Every job state change — enqueue, claim, complete, retry, dead-letter — is a single EVALSHA against the versioned bundle. Partial states are unrepresentable: no wire sequence exists that could produce one.

LAW 2

The fence before the first command

The echomq:2.0.0 handshake runs at connect and at every reconnect; a bundle-version mismatch is a typed refusal at boot, never a degraded session. Wrong-kind servers are refused the way wrong-kind ids are.

LAW 3

Jobs are entities

Chapter 3.2 registers JOB under the D-8 bar — jobs are minted, gated, paged, and audited like any kind, and the order theorem gives queue browsing for free because job ids sort by submission.

LAW 4

Park, don't poll

Idle consumers block on keys and cost nothing; readiness arrives as a wake, not a discovered flag. Fairness across groups is constructed — round-robin lanes by assignment — never hashed.

LAW 5

Delivery semantics, named per surface

At-least-once is stated where it holds and made cheap to honor: enqueue is idempotent by job id, and checkpoints survive consumer crashes so a redelivery resumes instead of repeating.

LAW 6

Rivals measured with advantages printed

The closing chapter benchmarks against the transactional-enqueue class. Oban's same-transaction enqueue is a real advantage, and its number appears beside the bus's — a gate that hides the rival's win is decoration.

§3

The floor under the floor

committed outputs, quoted verbatim

Part III is fully written, and every chapter lands with a rung — an executable check and a frozen transcript, committed beside the prose. The course inherits the ethic: a number that is not in a committed output does not appear on a page. The six chapter rungs, the conformance record, and the connector gate on file:

content/echo_data/runtimes/elixir/ · the Part III rungs and the connector gatefrozen
bcs_rung_3_1_check.out   the fence and the keyspace        PASS 5/5
bcs_rung_3_2_check.out   jobs are entities                 PASS 5/5
bcs_rung_3_3_check.out   the state machine in Lua          PASS 6/6
bcs_rung_3_4_check.out   fair lanes                        PASS 8/8
bcs_rung_3_5_check.out   the bus meets the stores          PASS 6/6
bcs_rung_3_6_check.out   conformance and the rival         PASS 6/6   CONFORMANCE 14/14
emq_connector_check.out  the connector (Appendix A)        PASS 8/8

The connector gate ran against live Valkey; the conformance bench measured the bus against Oban 2.18.3 on PostgreSQL 16.14, with the asymmetry stated before the first ratio — the rival's enqueue is durable and transactional, the bus's is volatile by Decision D-2. What the part will not do is stated too: no Streams or PubSub (EMQ 3.0 by Decision D-3), and no cluster routing — the slot function is committed and parked, single-instance Valkey the stated topology.

§4

Up next

built as the manuscript ships
§5

The doors

the sibling courses
§6

References

sources · related

Sources

Related