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.

Files for asynchelper, version 0.1.4
Filename, size File type Python version Upload date Hashes
Filename, size asynchelper-0.1.4-py3-none-any.whl (3.6 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size asynchelper-0.1.4.tar.gz (3.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page