Language
How AWA works¶
AWA is a library and schema, not a separate broker service. Producers, workers, and operational tools coordinate through PostgreSQL.
The execution loop¶
- A producer serializes typed arguments and inserts a job, optionally inside an application transaction.
- A worker asks PostgreSQL for runnable work in a configured queue.
- A claim records the attempt and establishes an ownership token. Other workers skip the claimed row.
- The worker heartbeats while the handler runs.
- Completion is accepted only while the worker still owns the claim. A retry, snooze, callback wait, failure, or completion becomes durable state.
- If heartbeats stop, another worker can rescue the expired claim and run the job again.
This produces an at-least-once contract. The ownership guard prevents a stale worker from overwriting a newer attempt, but it cannot make an external side effect exactly once.
Storage and runtime are separate responsibilities¶
awa-modelowns the schema, migrations, typed records, enqueue operations, and admin queries.awa-workerowns claiming, execution, heartbeats, retry scheduling, and graceful shutdown.awais the Rust facade that joins those pieces.awa-pgexposes the same model and worker runtime to Python.awa-cliand the web UI provide migrations and operational inspection.
See the detailed architecture and queue storage substrate when you need implementation-level invariants.