Module Expr Str ImportFrom alias ImportFrom alias ImportFrom alias alias identifier If NameLoad body ImportFrom alias orelse ImportFrom alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body While NameLoad body Assign TupleStore NameStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr TryExcept body Expr Call NameLoad NameLoad NameLoad handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list decorator_list ClassDef bases body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Assign AttributeStore NameLoad attr Call NameLoad IfExp NameLoad NameLoad Num Assign AttributeStore NameLoad attr NameLoad For NameStore Call NameLoad NameLoad body Expr Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults vararg kwarg body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad NameLoad NameLoad NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list decorator_list
N/A N/A 
Asynchronous Tasks
~~~~~~~~~~~~~~~~~~

A simple thread pool implementation, that can be used for parallel I/O.

Example usage::

    >>> def takes(long=10):
    ...     sleep(long)
    ...
    >>> pool = Threadpool(5)
    >>> for x in range(10):
    ...     pool.add_task(takes, x)
    >>> pool.wait_completion()

You can't retrieve the return values, just wait until they finish. threading Thread acrylamid log acrylamid.compat PY2K text_type str N/A PY2K N/A Queue Queue N/A queue Queue Worker N/A Thread N/A N/A Thread executing tasks from a given tasks queue __init__ N/A N/A self tasks N/A N/A N/A N/A N/A Thread __init__ self N/A N/A self tasks tasks N/A N/A self daemon True N/A N/A N/A self start N/A run N/A N/A self N/A N/A N/A True N/A N/A N/A func args kargs N/A N/A N/A self tasks get N/A N/A N/A N/A func args kargs N/A N/A N/A Exception N/A e N/A N/A N/A N/A log exception N/A %s: %s N/A N/A N/A e __class__ __name__ N/A str e N/A N/A N/A N/A self tasks task_done N/A N/A Threadpool N/A N/A N/A Initialize pool with number of workers, that run a function with
    given arguments and catch all exceptions. __init__ N/A N/A self num_threads wait N/A True N/A N/A N/A self tasks N/A Queue N/A wait num_threads 0 N/A N/A self wait wait N/A _ N/A range num_threads N/A N/A N/A Worker N/A self tasks N/A add_task N/A N/A self func N/A args kargs N/A N/A Add a task to the queue N/A N/A N/A N/A self tasks put N/A func args kargs N/A self wait N/A wait_completion N/A N/A self N/A N/A N/A Wait for completion of all the tasks in the queue N/A N/A N/A N/A self tasks join N/A N/A