twisted.test.test_threadpool.MemoryPool(threadpool.ThreadPool) class documentationtwisted.test.test_threadpool
(View In Hierarchy)
A deterministic threadpool that uses in-memory data structures to queue work rather than threads to execute work.
| Method | __init__ | Initialize this MemoryPoolwith a test case. | 
| Method | _pool | Override testing hook to create a deterministic threadpool. | 
Inherited from ThreadPool:
| Instance Variable | started | Whether or not the thread pool is currently running. (type: bool) | 
| Instance Variable | threads | List of workers currently running in this thread pool. (type: list) | 
| Method | workers | For legacy compatibility purposes, return a total number of workers. | 
| Method | working | For legacy compatibility purposes, return the number of busy workers as expressed by a list the length of that number. | 
| Method | waiters | For legacy compatibility purposes, return the number of idle workers as expressed by a list the length of that number. | 
| Method | start | Start the threadpool. | 
| Method | startAWorker | Increase the number of available workers for the thread pool by 1, up to
the maximum allowed by ThreadPool.max. | 
| Method | stopAWorker | Decrease the number of available workers by 1, by quitting one as soon as it's idle. | 
| Method | __setstate__ | Undocumented | 
| Method | __getstate__ | Undocumented | 
| Method | callInThread | Call a callable object in a separate thread. | 
| Method | callInThreadWithCallback | Call a callable object in a separate thread and call onResultwith the return value, or atwisted.python.failure.Failureif the callable raises an exception. | 
| Method | stop | Shutdown the threads in the threadpool. | 
| Method | adjustPoolsize | Adjust the number of available threads by setting minandmaxto new values. | 
| Method | dumpStats | Dump some plain-text informational messages to the log about the state 
of this ThreadPool. | 
| Method | _queue | For legacy compatibility purposes, return an object with a qsizemethod that indicates the amount of work not yet 
allocated to a worker. | 
| Method | _generateName | Generate a name for a new pool thread. | 
Initialize this MemoryPool
with a test case.
| Parameters | coordinator | a worker used to coordinate work in the Teamunderlying this 
threadpool. (type:twisted._threads.IExclusiveWorker) | 
| failTest | A 1-argument callable taking an exception and raising a test-failure 
exception. (type: 1-argument callable taking ( Failure) and 
raisingunittest.FailTest.) | |
| newWorker | a 0-argument callable that produces a new twisted._threads.IWorkerprovider on each invocation. (type: 0-argument callable returningtwisted._threads.IWorker.) | 
Override testing hook to create a deterministic threadpool.
| Parameters | currentLimit | A 1-argument callable which returns the current threadpool size limit. | 
| threadFactory | ignored in this invocation; a 0-argument callable that would produce a thread. | |
| Returns | a Teambacked by the 
coordinator and worker passed toMemoryPool.__init__. | |