Documentation
¶
Overview ¶
Command worker is the FRAMEWORK-MODE outbox consumer for the backend-guide example — the other half of the async story in docs/BACKEND_SPEC_LLM.md §6.
The engine's `Ctx.Enqueue(topic, payload)` writes a job in your handler's transaction (so the job exists if and only if the business write committed) and fires a notify on commit. THIS process drains it. It is a SEPARATE binary from the engine on purpose: a slow or crashing consumer must never hold a request open, pin a pool connection, or take the API down with it.
You do not need the shipped `appximo-worker` binary to do this — pkg/worker is a library, and a consumer is ~40 lines:
DATABASE_URL=... go run ./examples/backend-guide/worker
Scale it by running N IDENTICAL copies: the drain uses `SELECT … FOR UPDATE SKIP LOCKED`, so instances never collide on a row.