Package wtf :: Package opi :: Package worker :: Module threaded :: Class JobWorkerQueue
[hide private]
[frames] | no frames]

Class JobWorkerQueue

source code

object --+
         |
        JobWorkerQueue

Combined management of jobs and workers
Instance Methods [hide private]
 
__init__(self, pool)
Initialization
source code
 
startup(self)
Start the queue
source code
 
shutdown(self)
Shutdown the queue - finish all threads
source code
 
put_task(self, task)
Put a new task into the queue
source code
any
get_task(self, runner)
Get the next task out of the queue.
source code
 
register(self, runner)
Add a runner to the set
source code
 
unregister(self, runner)
Remove a runner from the list
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, pool)
(Constructor)

source code 
Initialization
Parameters:
Overrides: object.__init__

put_task(self, task)

source code 

Put a new task into the queue

This function blocks until there's actually space in the queue.

Parameters:
  • task (any) - The task to put, if None, the receiving runner should finish

get_task(self, runner)

source code 

Get the next task out of the queue.

This function blocks until there's actually a task available.

Returns: any
The new task, if None, the receiving runner should finish

register(self, runner)

source code 
Add a runner to the set
Parameters:

unregister(self, runner)

source code 
Remove a runner from the list
Parameters: