Skip to main content

asynchelper - Allows execution of unlimited number of asynchronous tasks while limiting the amount of active concurrent ones.

Project description

Latest PyPI version

Allows execution of unlimited number of asynchronous tasks while limiting the amount of active concurrent ones.

Usage

There are only two functions (for now):
  • asynchelper.TaskExecutor.map(task_generator: Iterable[callable], workers: Union(int, None) = 128)
    • task_generator can be any iterable which holds (or generates) coroutines.

    • workers is the maximum limit of active tasks concurrently. None for no limit.

    • This will keep pushing tasks in the iterable until it’s fully consumed.

  • asynchelper.TaskExecutor.forever(task: callable, args: Iterable = [], workers: Union(int, None) = 128)
    • task is an async funtion to create a couroutine from

    • args is an iterable of arguments to pass to task

    • workers is the maximum limit of active tasks concurrently. None for no limit

    • This will keep pushing the task(*args), running them forever with a limit of workers active tasks at any moment.


asynchelper was written by Mario Nascimento.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

asynchelper-0.1.3.tar.gz (3.4 kB view hashes)

Uploaded Source

Built Distribution

asynchelper-0.1.3-py3-none-any.whl (3.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page