Re: asyncio - how to stop loop?

2014-06-12 Thread Frank Millman
Ian Kelly ian.g.ke...@gmail.com wrote in message news:CALwzidnv07Wba9WJ=nuc0_v4mvudyaxwh6bgjvw0o1hf3oo...@mail.gmail.com... On Wed, Jun 11, 2014 at 1:19 AM, Frank Millman fr...@chagford.com wrote: First attempt - same as before loop = asyncio.get_event_loop()

asyncio - how to stop loop?

2014-06-11 Thread Frank Millman
Hi all I have a 'start.py' script that kicks off my program by starting a number of services. For now, I stop it by allowing the user to press enter, after which I close down the services and stop the program. (For production I imagine it would be better to run it in the background and send

Re: asyncio - how to stop loop?

2014-06-11 Thread Ian Kelly
On Wed, Jun 11, 2014 at 1:19 AM, Frank Millman fr...@chagford.com wrote: First attempt - same as before loop = asyncio.get_event_loop() threading.Thread(target=loop.run_forever).start() input('Press enter to stop') loop.stop() loop.close() Each event loop is hosted by a