_thread.WorkerPool API [rev. unknown]

class WorkerPool(object):

A WorkerPool allows to dispatch function executions to threads. Each Worker Thread is reused for multiple function executions. The dispatching operation takes care to create and dispatch to existing threads. You need to call shutdown() to signal the WorkerThreads to terminate and join() in order to wait until all worker threads have terminated.

methods:

def __init__(self, maxthreads=None):

init WorkerPool instance which may create up to `maxthreads` worker threads.

def dispatch(self, func, *args, **kwargs):

return Reply object for the asynchronous dispatch of the given func(*args, **kwargs) in a separate worker thread.

def join(self, timeout=None):

wait until all worker threads have terminated.

def shutdown(self):

signal all worker threads to terminate. call join() to wait until all threads termination.