[issue30782] Allow limiting the number of concurrent tasks in asyncio.as_completed

Yury Selivanov report at bugs.python.org
Mon Sep 9 10:41:34 EDT 2019


Yury Selivanov <yselivanov at gmail.com> added the comment:

We want to add TaskGroups to asyncio (a similar concept to Trio's nurseries).  TaskGroups use the `async with` statement to clearly define where Tasks are created and at which point they are expected to be completed or destroyed.

asyncio.gather(), asyncio.as_completed(), and few others will be considered legacy APIs after we implement TaskGroups.  Implementing rate limiting on top of TaskGroups is easier and more reliable.

I'd really prefer to keep as_completed() and especially gather() as is, as I consider them a bit broken already.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue30782>
_______________________________________


More information about the Python-bugs-list mailing list