TaskKit.TaskHandler | index /usr/local/share/webware/TaskKit/TaskHandler.py

Classes

``

TaskHandler

class TaskHandler
`` | `The task handler. While the Task class only knows what task to perform with the run()-method, the TaskHandler has all the knowledge about the periodicity of the task. Instances of this class are managed by the Scheduler in the scheduled, running and onDemand dictionaries.`

Methods defined here:

__init__(self, scheduler, start, period, task, name)

disable(self)
  `Disable future invocations of this task.`

enable(self)
  `Enable future invocations of this task.`

isOnDemand(self)
  `Return True if this task is not scheduled for periodic execution.`

isRunning(self)

name(self)

notifyCompletion(self)

period(self)
  `Return the period of this task.`

reschedule(self)
  `Determine whether this task should be rescheduled.
  Increments the startTime and returns true if this is
  a periodically executed task.`

reset(self, start, period, task, reregister)

runAgain(self)
  `This method lets the Scheduler check to see whether this task should be
  re-run when it terminates`

runOnCompletion(self)
  `Request that this task be re-run after its current completion.
  Intended for on-demand tasks that are requested by the Scheduler while
  they are already running.`

runTask(self)
  `Run this task in a background thread.`

setPeriod(self, period)
  `Change the period for this task.`

startTime(self, newTime=None)

stop(self)

unregister(self)
  `Request that this task not be kept after its current completion.
  Used to remove a task from the scheduler.`

Functions

``

sleep(...)
  `sleep(seconds)
  Delay execution for a given number of seconds. The argument may be
  a floating point number for subsecond precision.`

time(...)
  `time() -> floating point number
  Return the current time in seconds since the Epoch.
  Fractions of a second may be present if the system clock provides them.`