Eidolon
|
Inherits object.
Public Member Functions | |
def | __init__ (self) |
def | processTaskQueue (self) |
def | addTasks (self, tasks) |
def | addFuncTask (self, func, name=None) |
def | listTasks (self) |
def | getNumTasks (self) |
def | taskExcept (self, ex, msg, title) |
Public Attributes | |
tasklist | |
finishedtasks | |
currentTask | |
doProcess | |
This represents a queue of tasks waiting to be executed and the algorithm to do so. The processTaskQueue() method handles executing each task in sequence and handling any exceptions that occur. The expected use case is that this class will be mixed in with another responsible for maintaining tasks and other system-level facilities.
def __init__ | ( | self | ) |
def addFuncTask | ( | self, | |
func, | |||
name = None |
|||
) |
Creates a task object (named 'name' or the function name if None) to call the function when executed.
def addTasks | ( | self, | |
tasks | |||
) |
Adds the given tasks to the task queue whether called in another task or not.
def getNumTasks | ( | self | ) |
Returns the number of queued tasks.
def listTasks | ( | self | ) |
Returns a list of the labels of all queued tasks.
def processTaskQueue | ( | self | ) |
Process the tasks in the queue, looping so long as self.doProcess is True. This method will not return so long as this condition is True and so should be executed in its own thread. Tasks are popped from the top of the queue and their start() methods are called. Exceptions from this method are handled through taskExcept().
def taskExcept | ( | self, | |
ex, | |||
msg, | |||
title | |||
) |
Called when the task queue encounters exception `ex' with message `msg' and report window title `title'.
currentTask |
doProcess |
finishedtasks |
tasklist |