Skip to content

darkarp/asynchelper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

asynchelper

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages