Skip to content

Huey

Package: z4j-huey - Huey 2.5+, django-huey 1.2+.

Terminal window
pip install z4j-huey

Huey exposes signals:

Huey signalz4j event
SIGNAL_ENQUEUEDtask_sent
SIGNAL_EXECUTINGtask_started
SIGNAL_COMPLETEtask_succeeded
SIGNAL_ERRORtask_failed
SIGNAL_RETRYINGtask_retry
SIGNAL_CANCELEDtask_cancelled
SIGNAL_EXPIREDtask_expired
VerbHow
retryhuey.enqueue(original_task_function, *args) - re-enqueues with same payload
cancelhuey.revoke_by_id(task_id)
purge_queuehuey.flush()

Huey’s @huey.periodic_task(crontab(...)) decorators are code - they can only be discovered by scanning decorated functions at agent start. z4j surfaces them as read-only schedules in the dashboard.

To pause a periodic task at runtime:

@huey.periodic_task(crontab(minute="0"))
def send_nightly_digest():
...

You can flip send_nightly_digest.disable() / enable() - but this is process-local, not cluster-global. z4j reports the state per-agent.

Single-process setups (SQLite huey, MemoryHuey) work but each process has its own queue. The dashboard reflects this.

  • Huey’s result expiry defaults to 7 days. If you look up an older task, you may get ResultTimeout - z4j renders this as “result expired” rather than lost.
  • No chord/group primitives.

See scheduler: huey-periodic.