Uranium
Application Framework
UM.JobQueue.JobQueue Class Reference

A thread pool and queue manager for Jobs. More...

Public Member Functions

def __init__
 Initialize. More...
 
def add
 Add a Job to the queue. More...
 
def remove
 Remove a waiting Job from the queue. More...
 
def getInstance (cls, args, kwargs)
 

Static Public Attributes

tuple jobStarted = Signal()
 Emitted whenever a job starts processing. More...
 
tuple jobFinished = Signal()
 Emitted whenever a job has finished processing. More...
 

Detailed Description

A thread pool and queue manager for Jobs.

The JobQueue class manages a queue of Job objects and a set of threads that can take things from this queue to process them.

See also
Job

Constructor & Destructor Documentation

def UM.JobQueue.JobQueue.__init__ (   self,
  thread_count 
)

Initialize.

Parameters
thread_countThe amount of threads to use. Can be a positive integer or 'auto'. When 'auto', the number of threads is based on the number of processors and cores on the machine.

Member Function Documentation

def UM.JobQueue.JobQueue.add (   self,
  job 
)

Add a Job to the queue.

Parameters
jobThe Job to add.
def UM.JobQueue.JobQueue.remove (   self,
  job 
)

Remove a waiting Job from the queue.

Parameters
jobThe Job to remove.
Note
If a job has already begun processing it is already removed from the queue and thus can no longer be cancelled.

Member Data Documentation

tuple UM.JobQueue.JobQueue.jobFinished = Signal()
static

Emitted whenever a job has finished processing.

Parameters
jobJob The job that has finished processing.
tuple UM.JobQueue.JobQueue.jobStarted = Signal()
static

Emitted whenever a job starts processing.

Parameters
jobJob The job that has started processing.

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