Effect Exactly-Once Consumer
A queue consumer that turns at-least-once delivery into exactly-once effect: it processes first and commits second, so a crash between the two causes redelivery instead of loss, and the dedupe check lives in the same atomic Ref.modify as the side effect, so a redelivered message is recognized, skipped, and committed without a window where it looks unprocessed twice. The demo also plays the wrong ordering (commit-then-process) to show the acknowledged message the broker never redelivers, which is how money disappears silently. Solves the lost message and the double-applied message, the two failure modes on either side of correct commit ordering. Pinned to effect 4.0.0-beta.98.
npx shadcn@latest add @compronents/effect-exactly-once-consumerInstalls from ui.aryank.space. Needs a registry token and a one-time @compronents entry in components.json. The docs walk through both.
The consumer commits offset 1 and then dies before applying pay-102. The broker's contract is simple: acknowledged work is never redelivered. The restart resumes at offset 2, and 250 dollars is gone with no error, no log line, no retry. Loss is silent by construction.