Class t.p.t.ThreadPool:

Part of twisted.python.threadpool View Source View In Hierarchy

This class (hopefully) generalizes the functionality of a pool of threads to which work can be dispatched.

dispatch(), dispatchWithCallback() and stop() should only be called from a single thread, unless you make a subclass where stop() and _startSomeWorkers() are synchronized.
Method __init__ Create a new threadpool.
Method start Start the threadpool.
Method startAWorker Undocumented
Method stopAWorker Undocumented
Method __setstate__ Undocumented
Method __getstate__ Undocumented
Method _startSomeWorkers Undocumented
Method dispatch Dispatch a function to be a run in a thread.
Method callInThread Undocumented
Method _runWithCallback Undocumented
Method dispatchWithCallback Dispatch a function, returning the result to a callback function.
Method _worker Undocumented
Method stop Shutdown the threads in the threadpool.
Method adjustPoolsize Undocumented
Method dumpStats Undocumented
def __init__(self, minthreads=5, maxthreads=20, name=None): (source)
Create a new threadpool.
Parametersminthreadsminimum number of threads in the pool
maxthreadsmaximum number of threads in the pool
def start(self): (source)
Start the threadpool.
def startAWorker(self): (source)
Undocumented
def stopAWorker(self): (source)
Undocumented
def __setstate__(self, state): (source)
Undocumented
def __getstate__(self): (source)
Undocumented
def _startSomeWorkers(self): (source)
Undocumented
def dispatch(self, owner, func, *args, **kw): (source)
Dispatch a function to be a run in a thread.
def callInThread(self, func, *args, **kw): (source)
Undocumented
def _runWithCallback(self, callback, errback, func, args, kwargs): (source)
Undocumented
def dispatchWithCallback(self, owner, callback, errback, func, *args, **kw): (source)

Dispatch a function, returning the result to a callback function.

The callback function will be called in the thread - make sure it is thread-safe.
def _worker(self, o): (source)
Undocumented
def stop(self): (source)
Shutdown the threads in the threadpool.
def adjustPoolsize(self, minthreads=None, maxthreads=None): (source)
Undocumented
def dumpStats(self): (source)
Undocumented
API Documentation for twisted, generated by pydoctor.