APScheduler
Requires APScheduler 3.10.2+ and <4, Python 3.11+. See the compatibility matrix for the full pin string.
Install
Section titled “Install”pip install z4j-apschedulerSupported jobstores
Section titled “Supported jobstores”| Jobstore | Inventory and advertised controls |
|---|---|
SQLAlchemyJobStore |
✓ |
RedisJobStore |
✓ |
MongoDBJobStore |
✓ |
MemoryJobStore |
✓ (jobs are lost on restart) |
Operations
Section titled “Operations”The adapter advertises list, enable, disable, trigger-now, and delete. It uses resume_job, pause_job, modify_job(next_run_time=...), and remove_job for those controls. Create and update are not advertised and raise NotImplementedError if called directly.
Trigger projection
Section titled “Trigger projection”| APScheduler trigger | z4j projection |
|---|---|
CronTrigger |
cron, with the trigger string as the expression |
IntervalTrigger |
interval, with interval_length as the expression |
DateTrigger |
clocked, with run_date as the expression |
| Compound or custom trigger | fallback cron projection with the trigger string, or unknown |
The advertised controls address the native job by ID and are not limited by the projected trigger kind. The projection does not make compound or custom triggers editable through create/update.
Common pairings
Section titled “Common pairings”- Dramatiq + APScheduler - APScheduler fires, Dramatiq executes.
- Standalone - APScheduler as a general-purpose "do X every Monday at 03:00".
Multiple schedulers
Section titled “Multiple schedulers”One agent runtime can register one apscheduler adapter entry. Every APScheduler adapter has the same name, and the runtime stores scheduler adapters by name, so a later instance would replace the earlier one. Use separate agent processes when multiple scheduler instances must appear independently.
Caveats
Section titled “Caveats”- Misfire grace time - z4j preserves
misfire_grace_time; surfaced as a field in the schedule detail. - Coalescing - preserved.
- Max instances - preserved.