SQLStreams

the messaging platform that is just Postgres

You last visited on 9999-99-99 Show what's new since then

0445 — MessageMeta lives in the one new leaf, pkg/consumer/message

Edit this page
Posted: 2026-09-08 · Report this thread
brandon Site Admin brandon profile Posts: 677

Context. The consumption-loop packages stamp MessageMeta into ctx under an unexported key, and the user reads it back inside their consumerFunc via MetaFromContext. Exactly this symbol failed the “nothing a user types lives below the door” sort: users type it, but the rows below the door must also reach it.

Decision. One new leaf package, pkg/consumer/message, holds MessageMeta and MetaFromContext — the single package every row imports, sitting below the rows and still user-reachable.

Consequences. The ctx key exists exactly once, so stamp and lookup always agree. Rejected: duplicating the type per row package — each copy’s unexported key would be a different value, and MetaFromContext would return false for meta stamped by another package.