Home | Trees | Index | Help |
---|
Package twisted :: Package python :: Module threadpool :: Class ThreadPool |
|
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 Summary | |
---|---|
__init__(self,
minthreads,
maxthreads)
| |
__getstate__(self)
| |
__setstate__(self,
state)
| |
callInThread(self,
func,
*args,
**kw)
| |
Dispatch a function to be a run in a thread. | |
Dispatch a function, returning the result to a callback function. | |
dumpStats(self)
| |
Start the threadpool. | |
Shutdown the threads in the threadpool. |
Class Variable Summary | |
---|---|
int |
joined
|
int |
max
|
int |
min
|
int |
started
|
int |
workers
|
Method Details |
---|
dispatch(self, owner, func, *args, **kw)Dispatch a function to be a run in a thread. |
dispatchWithCallback(self, owner, callback, errback, func, *args, **kw)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. |
start(self)Start the threadpool. |
stop(self)Shutdown the threads in the threadpool. |
Class Variable Details |
---|
joined
|
max
|
min
|
started
|
workers
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 1.1 on Fri Jun 27 03:45:59 2003 | http://epydoc.sf.net |