z4j-huey
The Huey engine adapter for z4j.
Streams supported Huey task lifecycle events from your consumers to the z4j
brain and accepts operator control actions from the dashboard. Pair
with z4j-hueyperiodic to surface @periodic_task schedules.
What it ships
| Capability | Notes |
|---|---|
| Task lifecycle events | enqueued, started, succeeded, failed, retried, revoked |
| Timeouts and rate limits (Huey 3) | a timeout that is not retried is reported as failed, a rate limit that is not retried as revoked; either one followed by a retry is reported as the retry alone |
| Task discovery | Huey's in-process task registry |
| Submit | direct against the Huey instance |
| Retry | requires both complete operator-supplied replacement args and kwargs because Huey cannot recover the original signature by task id |
| Cancel | prevents a pending task from starting; Huey cannot interrupt already-running work |
| Reconcile task | probes Huey's result store; absence reports honest unknown |
Not supported (Huey offers no faithful primitive for them, so the adapter declines the capability instead of faking it): bulk retry and queue purge (Huey's storage cannot select completed jobs by filter or purge a single queue), dead-letter requeue (Huey has no dead-letter store), worker restart and rate limiting (Huey consumers expose no remote-control channel). Cancel uses Huey's revoke-by-id primitive. It prevents a pending task from starting but cannot stop running work.
Compatibility
- Huey 2.4 and later, with no upper bound: Huey 2 and Huey 3 are both supported. The package's suite runs a real Huey consumer on Huey 2.4.0 and on Huey 3.4.0 and asserts the exact sequence of events for every lifecycle path on each: one terminal event per task, and never a terminal event and a retry for the same attempt.
- Huey older than 2.5.3 has no enqueue signal. On those releases a task first appears when it starts, and its arguments are not captured.
- Storage backends: redis, sqlite, in-memory
- Python 3.11+
Full per-adapter matrix at https://docs.z4j.com/reference/compatibility/.
Changing the Huey major
Upgrading Huey from 2 to 3 needs nothing from the adapter: a Huey 3 consumer reads the work a Huey 2 process enqueued.
Downgrading Huey from 3 to 2 loses queued work unless you drain first. Huey 3
writes a wider queue message than Huey 2 can read, so a Huey 2 consumer raises
TypeError on every task a Huey 3 process enqueued and the task is gone; a
scheduled task that has come due is dropped the same way. Before downgrading
Huey, stop enqueueing and let the queue and the schedule empty. Run one Huey
major in every process that shares a queue, including the process that hosts
the z4j agent.
This is Huey's own queue format, and z4j does not change it in either direction: a retry or a schedule fire is enqueued through your Huey instance in that Huey's format, and the adapter reads task state from the result store, which both majors read from each other.
Install
pip install z4j-huey z4j-hueyperiodic
Pair with a framework adapter:
pip install z4j-django z4j-huey z4j-hueyperiodic # Django
pip install z4j-flask z4j-huey z4j-hueyperiodic # Flask
pip install z4j-fastapi z4j-huey z4j-hueyperiodic # FastAPI
pip install z4j-bare z4j-huey z4j-hueyperiodic # framework-free worker
Pairs with
z4j-hueyperiodic, schedule adapter for Huey@periodic_task
Reliability
- Lifecycle-capture failures are isolated from Huey hooks and task code; capture hooks make no brain network request inline.
- The in-process event queue and SQLite outbound buffer are bounded. Queue overflow drops new events and buffer pressure evicts oldest rows; both losses are logged.
Documentation
Full docs at docs.z4j.com/engines/huey/.
License
Apache-2.0, see LICENSE.
Links
- Homepage: https://z4j.com
- Documentation: https://docs.z4j.com
- PyPI: https://pypi.org/project/z4j-huey/
- Issues: https://github.com/z4jdev/z4j-huey/issues
- Changelog: CHANGELOG.md
- Security: security@z4j.com (see SECURITY.md)
Metadata
Release files for z4j-huey 1.13.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| z4j_huey-1.13.0.tar.gz | 44.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| z4j_huey-1.13.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 67.2 kB
Release files / z4j_huey-1.13.0.tar.gz
| Download URL | z4j_huey-1.13.0.tar.gz |
|---|---|
| Size | 44.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
95865fdce7e20a0c80436d2a855d3d221d474b805c541e946dce1b13544b2b88
|
|
BLAKE2b-256 checksum How to use checksums |
da80f086ef501d45c28cd4ddd5d02d6ca5f3365830711be7d6f1d5a5be905702
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / z4j_huey-1.13.0-py3-none-any.whl
| Download URL | z4j_huey-1.13.0-py3-none-any.whl |
|---|---|
| Size | 23.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
060f3316c6d967879fc28048d6ba51cccd77016c9da74fb59c5a9b26e6b2cb42
|
|
BLAKE2b-256 checksum How to use checksums |
22e074254f7aa9b03986fda28fb428d282c972a3904d2c417e8f5f7a3b9b7227
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Security for z4j-huey 1.13.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.