Skip to content

APScheduler

Requires APScheduler 3.10.2+ and <4, Python 3.11+. See the compatibility matrix for the full pin string.

Terminal window
pip install z4j-apscheduler
Jobstore Inventory and advertised controls
SQLAlchemyJobStore
RedisJobStore
MongoDBJobStore
MemoryJobStore ✓ (jobs are lost on restart)

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.

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.

  • Dramatiq + APScheduler - APScheduler fires, Dramatiq executes.
  • Standalone - APScheduler as a general-purpose "do X every Monday at 03:00".

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.

  • Misfire grace time - z4j preserves misfire_grace_time; surfaced as a field in the schedule detail.
  • Coalescing - preserved.
  • Max instances - preserved.