Package core :: Package controllers :: Package threads :: Module threadpool :: Class WorkerThread
[hide private]
[frames] | no frames]

Class WorkerThread




Background thread connected to the requests/results queues.

A worker thread sits in the background and picks up work requests from one queue and puts the results in another until it is dismissed.

Instance Methods [hide private]
  __init__(self, requestsQueue, resultsQueue, **kwds)
Set up thread in damonic mode and start it immediatedly.
  run(self)
Repeatedly process the job queue until told to exit.
  dismiss(self)
Sets a flag to tell the thread to exit when done with current job.

Inherited from threading.Thread: __repr__, getName, isAlive, isDaemon, join, setDaemon, setName, start

Inherited from threading.Thread (private): _set_daemon

Inherited from threading._Verbose (private): _note

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__


Properties [hide private]

Inherited from object: __class__


Method Details [hide private]

__init__(self, requestsQueue, resultsQueue, **kwds)
(Constructor)

 

Set up thread in damonic mode and start it immediatedly.

requestsQueue and resultQueue are instances of Queue.Queue passed by the ThreadPool class when it creates a new worker thread.
Overrides: threading.Thread.__init__

run(self)

 
Repeatedly process the job queue until told to exit.
Overrides: threading.Thread.run

dismiss(self)

 
Sets a flag to tell the thread to exit when done with current job.