When you have `await task` line you probably know what
task it is, you can debug and fix it.
But hanging on `loop.close()` because some unknown task hangs
looks very confusing.
The approach gives no clue for what task is malformed.
Users will blame that `loop.close()` hangs forever without any
reason or additional information.
ok, regardless
placing this code inside `loop.close()` is there
any alternative to sure async generators inside `main()` are closed?
loop.run_until_complete(main())
pending = asyncio.Task.all_tasks()
loop.run_until_complete(asyncio.gather(*pending))
loop.close()
Currently, I just don't see any other way to use some async
generator (that needs some time to be closed) without getting
warning.
In case malformed generator is unwanted behaviour may
be it'll be ok to show warning in debug mode if some close task
isn't finished after some timeout?