Table of Contents

Class: ITaskQueue ./src/peak/running/interfaces.py

Schedule and run prioritized periodic tasks using the system reactor

When more than one task is available for execution, the highest priority one is executed. (Equal priority tasks are scheduled in round-robin fashion.) A task is considered available for execution when it is first added, and when its pollInterval elapses after its last execution.

Whenever the queue is enabled (the default state), tasks are executed and scheduled. When disabled, execution and scheduling stops until re-enabled. Enabling and disabling do not affect the task schedule in any way, although while the queue is disabled, tasks may pile up in the "available" state. (Note: a task queue is allowed to let the system reactor hold onto waiting tasks, so if the reactor's state is reset, queue contents may be lost whether the queue is enabled or not.)

Unlike many scheduling-related components, you may have as many of these as you like, but each must have access to an IBasicReactor and an IMainLoop.

Note, by the way, that this interface does not include a way to remove tasks from the queue. A task may remove itself from the queue by raising StopRunning when it is invoked.

Base Classes   
Interface
Methods   
addTask
disable
enable
  addTask 
addTask ( ptask )

Add IPeriodicTask instance ptask to the priority queue

  disable 
disable ()

Stop executing tasks after the current task completes

  enable 
enable ()

Allow all added tasks to run (default state)


Table of Contents

This document was automatically generated on Mon Nov 11 01:11:03 2024 by HappyDoc version 2.1