text: Async tools for Python
  Project description
  AsyncTools
  Async Tools for Python.
  Table of Contents
  - Threading
  - Async
  - Parallel
  - Pool
  Threading
  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.
  Async
  Source: asynctools/threading/Async.py
  Decorator for functions that should be run in a separate thread. When the function is called, it returns a `threading.Event <>`__.
  from asynctools.threading import Async @Async def request(url): # ... do request request('') # Async request request('').wait() # wait for it to complete
  If you want to wait for multiple threads to complete, see next chapters.
  Parallel
  Source: asynctools/threading/Parallel.py
  Execute functions in parallel and collect results. Each function is executed in its own thread, all threads exit immediately.
  Methods:
  - __call__(*args, **kwargs): Add a job. Call the Parallel object so it calls the worker function with the same arguments
  - map(jobs): Convenience method to call the worker for every argument
  - first(timeout=None): Wait for a single result to be available, with an optional timeout in seconds. The result is returned as soon as it’s ready. If all threads fail with an error – None is are same with `Parallel <#parallel>`__, with some additions:
  - __call__(*args, **kwargs)
  - map(jobs)
  - first(timeout=None)
  -()
  Project details
  Download files
  Download the file for your platform. If you're not sure which to choose, learn more about installing packages.