Skip to content

An extended version of asyncio.TaskGroup that controls the rate at which coroutines are scheduled.

License

Notifications You must be signed in to change notification settings

mgberg/task-executor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Task Executor

An extension to asyncio.TaskGroup that adds a submit method like concurrent.futures.ThreadPoolExecutor. The rate at which coroutines submitted this way are scheduled can be limited by either or both of the following:

  • max_concurrency: The maximum number of submitted coroutines that can be scheduled concurrently at a time. Similar effect as the max_workers parameter for concurrent.futures.ThreadPoolExecutor.
  • rate_limit: The maximium number of coroutines that can be scheduled per second.

Note that create_task can still be used. It behaves exactly as it does for asyncio.TaskGroup. Tasks created that way are unaffected by and are completely independent from coroutines submitted via submit, and have no impact on the rate at which submitted coroutines are scheduled.

About

An extended version of asyncio.TaskGroup that controls the rate at which coroutines are scheduled.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages