Matt Matt - 7 months ago 57
Python Question

Python asyncio monitoring

I've a python program which are launching a random number of asyncio coroutine. During the time my program can launch new ones and some of them can exit when they have terminated their work.

I would like to know if it's possible to report, every minute, the number of active coroutine?



You cannot launch a coroutine but could start a new task

For retrieving the number of active tasks please use len(asyncio.Task.all_tasks()).