apscheduler.schedulers.twisted

class apscheduler.schedulers.twisted.TwistedScheduler(gconfig={}, **options)

Bases: BaseScheduler

A scheduler that runs on a Twisted reactor.

Extra options:

reactor

Reactor instance to use (defaults to the global reactor)

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

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.twisted.TwistedScheduler(gconfig={}, **options)

Bases: BaseScheduler

A scheduler that runs on a Twisted reactor.

Extra options:

reactor

Reactor instance to use (defaults to the global reactor)

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

wakeup()

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

Introduction

TwistedScheduler was meant to be used in Twisted applications. By default it uses the reactor’s thread pool to execute jobs.

Default executor

TwistedExecutor

External dependencies

twisted

Example

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