Skip to content

Adapter axes

z4j adapters are organized along three independent axes. They compose freely: any framework × any engine × any scheduler is supported.

A framework adapter knows how your process boots and how to read its settings.

PackageCovers
z4j-djangoDjango 4.2 – 5.x. Reads settings.Z4J. Uses app-config for agent lifecycle.
z4j-flaskFlask 2.x / 3.x. Z4J(app, config) factory-style init.
z4j-fastapiFastAPI 0.10x+. Z4JAgent context manager in the lifespan.
z4j-bareAny Python 3.10+ process. Direct Agent(...) usage. Foundation of all others.

All framework adapters delegate the actual agent runtime to z4j-bare.

An engine adapter knows how your queue enqueues, executes, and fails tasks.

PackageEngineNative retryNative cancelBulk retrySchedule support
z4j-celeryCelery 5+partialpolyfillcelery-beat
z4j-rqRQ 1.15+polyfillrq-scheduler
z4j-dramatiqDramatiq 1.15+nopolyfillAPScheduler
z4j-hueyHuey 2.5+partialpartialpolyfillhuey-periodic
z4j-arqarq 0.25+polyfillpolyfillarq cron
z4j-taskiqtaskiq 0.11+polyfilltaskiq-scheduler

“polyfill” means: the brain implements the capability by re-enqueueing with the original payload and cancelling the original. The user sees one uniform button.

A scheduler adapter knows how to discover, create, update, and delete periodic tasks.

PackageSchedulerReadWriteNotes
z4j-celerybeatcelery-beat✓ (if django-celery-beat)Filesystem beat is read-only
z4j-rqschedulerrq-schedulerread-only in v1.0Writable UI on v1.1 roadmap
z4j-apschedulerAPScheduler 3Works standalone or with Dramatiq
z4j-hueyperiodicHuey periodic tasksread-onlyDecorators are code; UI can’t add new ones
z4j-arqcronarq cron jobsread-onlySame limitation - decorators in source
z4j-taskiq-schedulertaskiq-schedulerDepends on backend (Redis / file)

You install one framework + one or more engines + zero or more schedulers:

Terminal window
# Django + Celery + beat
pip install z4j-django z4j-celery z4j-celerybeat
# Flask + RQ + scheduler + Dramatiq + APScheduler (unusual but supported)
pip install z4j-flask z4j-rq z4j-rqscheduler z4j-dramatiq z4j-apscheduler

The framework adapter discovers the installed engines and schedulers via entry points; no wiring code.

The adapter interface is public but not yet documented for third-party authors - see roadmap. Drop-in custom engine adapters are on the v1.x list driven by community interest.

See the per-engine pages for the exact adapter surface of each.