10 Feb
2015
10 Feb
'15
11:04 p.m.
2015-02-10 14:56 GMT+01:00 Paul Moore <p.f.moore@gmail.com>:
On 10 February 2015 at 13:42, Victor Stinner <victor.stinner@gmail.com> wrote:
Maybe I should repeat the information somewhere else in the documentation?
Not many of the code samples seem to include loop.close().
Which code samples? I tried to ensure that all code snippets in asyncio doc and all examples in Tulip repository call loop.close().
Maybe they should?
Yes.
For example, if I have a loop.run_forever() call, should it be enclosed in try: ... finally: loop.close() to ensure the loop is closed?
"loop.run_forever(); loop.close()" should be fine. You may use try/finally if you don't want to register signal handlers for SIGINT/SIGTERM (which is not supported on Windows yet...). Victor