Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | Related Pages

TaskEngine Class Reference

List of all members.

Public Member Functions

 __init__ (name=None)
 name ()
 Method for querying the task engine's name.
 spawn (task, args, kwargs)
 Method used to queue a task to the task engine.
 run ()
 The task engine main routine.
 shutdown (tmo=2.0)
 Method for shutting down the task engine.

Detailed Description

A class for setting up and queueing tasks to a task engine.

A task engine is a thread that polls a task queue and runs tasks found on the queue. Tasks are functions or class methods accompanied with their arguments and keyword arguments. Each task must run to completion before the next task is pulled from the queue. Returning a return value from the task to the caller is currently not supported (easy to add, if the need arises). The queue is a FIFO queue and there is currently no way to jam a task to the head of the queue.

Definition at line 22 of file taskEngine.py.


Member Function Documentation

name  ) 
 

Method for querying the task engine's name.

Returns:
The task engine's name

run  ) 
 

The task engine main routine.

This method is invoked by the Thread class and should be considered 'protected'. Do not call it.

shutdown tmo  = 2.0  ) 
 

Method for shutting down the task engine.

This method blocks (with a timeout) until the task engine has exited. It makes no sense to spawn this method to the task engine since it waits for the task engine to exit.

Parameters:
tmo The amount of time (seconds) to wait for the task engine to exit
Returns:
0 for success, -1 if the task engine didn't exit, -2 if the task engine exited prematurely

spawn task  ,
args  ,
kwargs 
 

Method used to queue a task to the task engine.

Parameters:
task The task routine to queue
args The arguments for the task routine
kwargs The keyword arguments for the task routine


The documentation for this class was generated from the following file:
Generated on Fri Jul 21 13:28:02 2006 for LATTE R04-12-00 by doxygen 1.4.3