Pool

Create a pool of threads and execute work in it. Useful if you do want
to launch a limited number of long-living threads.

Methods are same with `Parallel <#parallel>`__, with some additions:

__call__(*args, **kwargs)

map(jobs)

first(timeout=None)

close(): Terminate all threads. The pool is no more usable when
closed.

__enter__, __exit__ context manager to be used with with
statement

Example:

fromasynctools.threadingimportPooldefrequest(url):# ... do long requestreturndata# Make poolpool=Pool(request,5)# Assign some jobforurlinlinks:pll(url)# Runs in a pool# Wait for the resultsresults,errors=pll.join()