Matt Matt - 1 year ago 104
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?


Answer Source

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()).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download