Eidolon
Public Member Functions | Public Attributes | List of all members
TaskQueue Class Reference

Inherits object.

Collaboration diagram for TaskQueue:
Collaboration graph

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self)

Member Function Documentation

◆ addFuncTask()

def addFuncTask (   self,
  func,
  name = None 
)
Creates a task object (named 'name' or the function name if None) to call the function when executed.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addTasks()

def addTasks (   self,
  tasks 
)
Adds the given tasks to the task queue whether called in another task or not.
Here is the caller graph for this function:

◆ getNumTasks()

def getNumTasks (   self)
Returns the number of queued tasks.
Here is the caller graph for this function:

◆ listTasks()

def listTasks (   self)
Returns a list of the labels of all queued tasks.

◆ processTaskQueue()

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().
Here is the call graph for this function:
Here is the caller graph for this function:

◆ taskExcept()

def taskExcept (   self,
  ex,
  msg,
  title 
)
Called when the task queue encounters exception `ex' with message `msg' and report window title `title'.
Here is the caller graph for this function:

Member Data Documentation

◆ currentTask

currentTask

◆ doProcess

doProcess

◆ finishedtasks

finishedtasks

◆ tasklist

tasklist

The documentation for this class was generated from the following file: