Durable queues, streams, pub/sub, and cron scheduler on SQLite. One file, zero servers.
Project description
honker (Python)
Python binding for Honker: durable queues, streams, pub/sub, and time-trigger scheduling on SQLite.
Full docs live in the main repo and docs site:
Install
pip install honker
The Python wheel includes Honker's SQLite loadable extension when the
package is built through the release/proof workflow. To load Honker into
your own sqlite3 or ORM connection:
import honker
import sqlite3
conn = sqlite3.connect("app.db")
honker.load_extension(conn)
conn.execute("SELECT honker_bootstrap()")
If a client needs the raw pieces instead, use extension_info():
path, entrypoint = honker.extension_info()
For local source builds, build and copy the extension before building the wheel:
git clone https://github.com/russellromney/honker
cd honker
cargo build --release -p honker-extension
scripts/copy-python-extension.sh
Quick start
import honker
db = honker.open("app.db")
q = db.queue("emails")
q.enqueue({"to": "alice@example.com"})
async for job in q.claim("worker-1"):
send_email(job.payload)
job.ack()
Delayed jobs use run_at:
import time
q.enqueue({"to": "later@example.com"}, run_at=int(time.time()) + 10)
Recurring schedules are registered on a Scheduler. Build the schedule with
crontab(expr) or every_s(n), then run the scheduler loop (it enqueues onto
the target queue on each boundary; a normal worker claims the jobs):
from honker import Scheduler, crontab, every_s
sched = Scheduler(db)
sched.add(name="fast", queue="emails", schedule=every_s(1), payload={"kind": "tick"})
sched.add(name="nightly", queue="emails", schedule=crontab("0 3 * * *"))
await sched.run() # acquires the leader lock and fires due tasks
add() is keyword-only and schedule must be a CronSchedule (from crontab
or every_s), not a raw string. Supported schedule expressions:
- 5-field cron:
crontab("0 3 * * *") - 6-field cron:
crontab("*/2 * * * * *") - interval:
every_s(1)(useevery_s, notcrontab("@every …"))
Notes
claim()wakes on database updates and on due deadlines likerun_at.scheduleis the canonical recurring-schedule name.cronstill works as a compatibility alias in older call sites.- Construct
db.queue(name)handles outside an opendb.transaction(). First open for a name runs schema init in its own write transaction; doing that inside an outertransaction()raisesRuntimeError(would otherwise deadlock the single writer). Create the handle first, then passtx=toenqueue.
For streams, notify/listen, tasks, SQL extension usage, and full scheduler docs, see the main repo and docs site.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file honker-0.4.0-cp311-abi3-win_amd64.whl.
File metadata
- Download URL: honker-0.4.0-cp311-abi3-win_amd64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.11+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
958eeb65619aa2858ccc9c525dde40a6a08ebb2491d2c003755fc9e8fa55cd82
|
|
| MD5 |
2d42ca6a67db4948234ced1962741548
|
|
| BLAKE2b-256 |
22a6145926dc2acd50580f5fb26c39797e2f2aad6d3b54d0efc2962259de5197
|
File details
Details for the file honker-0.4.0-cp311-abi3-manylinux_2_38_x86_64.whl.
File metadata
- Download URL: honker-0.4.0-cp311-abi3-manylinux_2_38_x86_64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.11+, manylinux: glibc 2.38+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d42a2e97954510f3c471c44eb12b1e89652127a158fa64f1f9bdf5f5b2bc22d5
|
|
| MD5 |
21a55c1b6fc08fa82b949efb0e4fcc2e
|
|
| BLAKE2b-256 |
f8af6ba0acc7bce3cb8fa1abbf2cffde472f293e8132d0bd29ebca3c5d968170
|
File details
Details for the file honker-0.4.0-cp311-abi3-manylinux_2_38_aarch64.whl.
File metadata
- Download URL: honker-0.4.0-cp311-abi3-manylinux_2_38_aarch64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.11+, manylinux: glibc 2.38+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9200a40ad9d4e632284ac0d9b4cf679bcdebd264b60a05b9de4e036ca634602
|
|
| MD5 |
c7e6149449cbd202d9b400bb0893250a
|
|
| BLAKE2b-256 |
40a9e5e458e67335c6629ac0caccdfa991ab7965bc528dedf425f231228f9f67
|
File details
Details for the file honker-0.4.0-cp311-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: honker-0.4.0-cp311-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 978.1 kB
- Tags: CPython 3.11+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8db7c0d604e28b2fb0e6312fe956c1a2e06d41a201cc9c89fd51cdd9aacac05c
|
|
| MD5 |
9933d62d72cd89d14028a4502e19ed4c
|
|
| BLAKE2b-256 |
d404882e593f286ab7ff4b850bed52a9e3a5e8a38934c4450a95d41465fd758e
|
File details
Details for the file honker-0.4.0-cp311-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: honker-0.4.0-cp311-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 1.0 MB
- Tags: CPython 3.11+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c6b6b639e84bb33db6378386c8058339b1ad50fbc168f0cda0013de8ddbbd80
|
|
| MD5 |
25ba88a4ca0ffe7cf2dcbf20c32360eb
|
|
| BLAKE2b-256 |
46a85a37c4c35fc892e79499262e4abbd9cd0017a810d2a0eae4930b1e73966f
|