Detect an idle asyncio event loop

43 views
Skip to first unread message

az...@icloud.com

unread,
Nov 19, 2017, 3:26:03 AM11/19/17
to python-tulip
Is there some programming pattern that would enable me to detect when an asyncio event loop becomes idle in the following sense? Say that my execution path branches in some complex way, say, using asyncio.gather(), but I know that each branch eventually awaits some idle coroutine, such as a socket or a subprocess. Say I know these coroutines actually never yield, so the event loop will execute whatever python code it can but eventually will just wait for those idle coroutines. Is there a programmatic way to detect such a state and stop the loop?
Reply all
Reply to author
Forward
0 new messages