Skip to content

pwngh/taskq

Repository files navigation

taskq

A task queue inside the database you already run. Enqueue is an INSERT, so a task can be created in the same transaction as the business write that caused it — the outbox pattern with no relay, because the outbox is the queue. Workers claim with FOR UPDATE SKIP LOCKED, own each task through a lease (a server-side expiry) and a fencing token (a counter every write must match), and record outcomes with plain SQL. There is no server, no daemon, and no protocol.

PostgreSQL ≥ 14 is the reference engine; MySQL ≥ 8.0.16 ships as the taskq/mysql subpath with the same API and guarantees. Zero runtime dependencies — your pg or mysql2 pool enters through a structural interface. Execution is at-least-once with idempotent handlers; enqueue and outcome recording are exactly-once, enforced by the schema, not by application code.

Documentation

Consumer guides live in docs/: getting started, the engine's six statements, the MySQL engine, operations, the API reference, and how the claims are tested.

License

MIT © Preston Neal — see LICENSE.md.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors