Skip to content

Getting started

Terminal window
pip install honker

Requires Python 3.11+. The wheel bundles the Rust cdylib so you don’t need a separate extension download. macOS (arm64, x86_64) and Linux (x86_64, aarch64) wheels are published.

Open a database, create a queue, enqueue a job, and claim it, all in one script.

import honker
db = honker.open("app.db") # opens or creates the file
q = db.queue("greetings")
q.enqueue({"name": "world"})
job = q.claim_one("worker-1")
print(f"hello, {job.payload['name']}!")
job.ack()

The worker loop wakes within 1-2 ms when a new job lands, via a shared 1 ms PRAGMA data_version poll on the database. No application-level polling. (Two experimental alternatives — kernel filesystem events and mmap’d WAL-index reads — are available behind opt-in flags; see Watcher backends.)

import asyncio
import honker
async def main():
db = honker.open("app.db")
q = db.queue("emails")
async for job in q.claim("worker-1"):
try:
await send_email(job.payload)
job.ack()
except Exception as e:
# Scheduled retry with backoff. After max_attempts (default 3),
# the job moves to _honker_dead with last_error set.
job.retry(delay_s=60, error=str(e))
asyncio.run(main())

The killer feature of a SQLite-native queue: the enqueue lands in the same transaction as your business write. No dual-write problem, no outbox pattern to bolt on (though Honker has one for external systems).

with db.transaction() as tx:
tx.execute(
"INSERT INTO orders (id, total, customer_id) VALUES (?, ?, ?)",
[42, 9900, "alice"],
)
q.enqueue({"order_id": 42, "email_type": "confirmation"}, tx=tx)
# One COMMIT. Either both land or neither does.
  • Queues for priority, delays, retries, dead-letter
  • Tasks for Huey-style @task decorators (Python)
  • Streams for durable pub/sub with per-consumer offsets
  • Pub/Sub for pg_notify-style ephemeral signals
  • Scheduler for cron and @every time-trigger tasks
  • Using with an ORM for the integration philosophy and per-language recipes for every Honker binding
  • Extension reference for the full honker_* SQL function family