skip to navigation
skip to content

asynctools 0.0.1-0

Async tools for Python

Latest Version: 0.1.2-2

Async Tools for Python.


Threading is the most simple thing, but because of GIL it’s useless for computation. Only use when you want to parallelize the access to a blocking resource, e.g. network.


Source: asynctools/threading/

Execute functions in parallel and collect results. Each function is executed in its own thread, all threads exit immediately.


  • join(): Wait for all tasks to be finished, and return two lists:
    • A list of results
    • A list of exceptions


from asynctools.threading import Parallel

def request(url):
    # ... do request
    return data

# Execute
pll = Parallel(request)
for url in links:
    pll.job(url)  # Starts a new thread

# Wait for the results
results, errors = pll.join()


Source: asynctools/threading/

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


  • join(): Wait for all tasks to be finished and return (results, errors) (same as with `Pool <#pool>`__)
  • close(): Terminate all threads.
  • __enter__, __exit__ context manager to be used with with statement


from asynctools.threading import Pool

def request(url):
    # ... do long request
    return data

# Make pool
pool = Pool(request, 5)

# Assign some job
for url in links:
    pll.job(url)  # Runs in a pool

# Wait for the results
results, errors = pll.join()
File Type Py Version Uploaded on Size
asynctools-0.0.1-0.linux-x86_64.tar.gz (md5)
built for Linux-3.13.0-30-generic-x86_64-with-glibc2.4
"dumb" binary any 2014-07-17 4KB
asynctools-0.0.1-0.tar.gz (md5) Source 2014-07-17 4KB
  • Downloads (All Versions):
  • 7 downloads in the last day
  • 177 downloads in the last week
  • 989 downloads in the last month