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.
callInThread() 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 | dispatch | DEPRECATED: use callInThread
instead.
|
Method | callInThread | Undocumented |
Method | dispatchWithCallback | DEPRECATED: use twisted.internet.threads.deferToThread
instead.
|
Method | stop | Shutdown the threads in the threadpool. |
Method | adjustPoolsize | Undocumented |
Method | dumpStats | Undocumented |
Method | _startSomeWorkers | Undocumented |
Method | _runWithCallback | Undocumented |
Method | _worker | Method used as target of the created threads: retrieve task to run from the threadpool, run it, and proceed to the next task until threadpool is stopped. |
Parameters | minthreads | minimum number of threads in the pool |
maxthreads | maximum number of threads in the pool |
DEPRECATED: use callInThread
instead.
DEPRECATED: use twisted.internet.threads.deferToThread
instead.
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.