Closed brianmaissy closed 3 years ago
That is a good point. I must have had a reason why I didn't but I can't remember why that would be. I'll have a look later.
It's based off my version of this in Photons which at the time did include a version of shutdown_asyngens
@brianmaissy I'm struggling to remember the situation where cancel_all_tasks isn't enough to shutdown asyncgens and struggling to write a test where doing a loop.shutdown_asyncgens makes a difference. Do you have a code example of where not calling shutdown_asyncgens causes a problem?
There we go, it took me an hour and a half to find a scenario where it makes a difference lol.
How does #11 look @brianmaissy ?
Wow thanks for the fast response! I'm not familiar with the details of our use case, I asked my colleague @nzig to take a look at it
This can be closed now thanks to #11.
Before closing the temporary event loop in
OverrideLoop.__exit__()
, it might be a good idea to callloop.shutdown_asyncgens()
, likeasyncio.run()
does in its cleanup.