apscheduler.schedulers.blocking

class apscheduler.schedulers.blocking.BlockingScheduler(gconfig={}, **options)

Bases: BaseScheduler

A scheduler that runs in the foreground (start() will block).

shutdown(wait=True)

Shuts down the scheduler, along with its executors and job stores.

Does not interrupt any currently running jobs.

Parameters:

wait (bool) – True to wait until all currently executing jobs have finished

Raises:

SchedulerNotRunningError – if the scheduler has not been started yet

start(*args, **kwargs)

Start the configured executors and job stores and begin processing scheduled jobs.

Parameters:

paused (bool) – if True, don’t start job processing until resume() is called

Raises:
wakeup()

Notifies the scheduler that there may be jobs due for execution. Triggers _process_jobs() to be run in an implementation specific manner.

API

class apscheduler.schedulers.blocking.BlockingScheduler(gconfig={}, **options)

Bases: BaseScheduler

A scheduler that runs in the foreground (start() will block).

shutdown(wait=True)

Shuts down the scheduler, along with its executors and job stores.

Does not interrupt any currently running jobs.

Parameters:

wait (bool) – True to wait until all currently executing jobs have finished

Raises:

SchedulerNotRunningError – if the scheduler has not been started yet

start(*args, **kwargs)

Start the configured executors and job stores and begin processing scheduled jobs.

Parameters:

paused (bool) – if True, don’t start job processing until resume() is called

Raises:
wakeup()

Notifies the scheduler that there may be jobs due for execution. Triggers _process_jobs() to be run in an implementation specific manner.

Introduction

BlockingScheduler is the simplest possible scheduler. It runs in the foreground, so when you call start(), the call never returns.

BlockingScheduler can be useful if you want to use APScheduler as a standalone scheduler (e.g. to build a daemon).

Default executor

PoolExecutor

External dependencies

none

Example

examples/schedulers/blocking.py (view online).