Le lundi 19 janvier 2015, Luciano Ramalho <[email protected]> a écrit :
>
> Can I conclude that in practice, close() should not be called at all
> unless your own code actually created the loop instead of merely
> fetching it with asyncio.get_event_loop()?


Event loops must be closed. The first call to get_event_loop() creates an
event loop which must be closed when you are done.

If you run python with -Wd, you should see a warning because a pair of
sockets are not closed. Sockets are owned by the event loop.

I opened a issue to emit a ResourceWarning if an event loop (and
transports) are not explicitly closed:
http://bugs.python.org/issue23243

Victor

Reply via email to