apscheduler.events

API

class apscheduler.events.SchedulerEvent(code, alias=None)

An event that concerns the scheduler itself.

Variables:
  • code – the type code of this event

  • alias – alias of the job store or executor that was added or removed (if applicable)

class apscheduler.events.JobEvent(code, job_id, jobstore)

Bases: SchedulerEvent

An event that concerns a job.

Variables:
  • code – the type code of this event

  • job_id – identifier of the job in question

  • jobstore – alias of the job store containing the job in question

class apscheduler.events.JobSubmissionEvent(code, job_id, jobstore, scheduled_run_times)

Bases: JobEvent

An event that concerns the submission of a job to its executor.

Variables:

scheduled_run_times – a list of datetimes when the job was intended to run

class apscheduler.events.JobExecutionEvent(code, job_id, jobstore, scheduled_run_time, retval=None, exception=None, traceback=None)

Bases: JobEvent

An event that concerns the running of a job within its executor.

Variables:
  • scheduled_run_time – the time when the job was scheduled to be run

  • retval – the return value of the successfully executed job

  • exception – the exception raised by the job

  • traceback – a formatted traceback for the exception

Event codes

The following event codes are numeric constants importable from apscheduler.events.

Constant

Description

Event class

EVENT_SCHEDULER_STARTED

The scheduler was started

SchedulerEvent

EVENT_SCHEDULER_SHUTDOWN

The scheduler was shut down

SchedulerEvent

EVENT_SCHEDULER_PAUSED

Job processing in the scheduler was paused

SchedulerEvent

EVENT_SCHEDULER_RESUMED

Job processing in the scheduler was resumed

SchedulerEvent

EVENT_EXECUTOR_ADDED

An executor was added to the scheduler

SchedulerEvent

EVENT_EXECUTOR_REMOVED

An executor was removed to the scheduler

SchedulerEvent

EVENT_JOBSTORE_ADDED

A job store was added to the scheduler

SchedulerEvent

EVENT_JOBSTORE_REMOVED

A job store was removed from the scheduler

SchedulerEvent

EVENT_ALL_JOBS_REMOVED

All jobs were removed from either all job stores or one particular job store

SchedulerEvent

EVENT_JOB_ADDED

A job was added to a job store

JobEvent

EVENT_JOB_REMOVED

A job was removed from a job store

JobEvent

EVENT_JOB_MODIFIED

A job was modified from outside the scheduler

JobEvent

EVENT_JOB_SUBMITTED

A job was submitted to its executor to be run

JobSubmissionEvent

EVENT_JOB_MAX_INSTANCES

A job being submitted to its executor was not accepted by the executor because the job has already reached its maximum concurrently executing instances

JobSubmissionEvent

EVENT_JOB_EXECUTED

A job was executed successfully

JobExecutionEvent

EVENT_JOB_ERROR

A job raised an exception during execution

JobExecutionEvent

EVENT_JOB_MISSED

A job’s execution was missed

JobExecutionEvent

EVENT_ALL

A catch-all mask that includes every event type

N/A