Re: In asyncio, does the event_loop still running after run_until_complete returned?

2018-04-04 Thread Ian Kelly
On Tue, Apr 3, 2018 at 9:20 PM, wrote: > What's the purpose of resetting self._stopping back to False in finally > clause? Presumably so that the loop won't immediately stop again if you restart it. -- https://mail.python.org/mailman/listinfo/python-list

Re: In asyncio, does the event_loop still running after run_until_complete returned?

2018-04-03 Thread jfong
Ian於 2018年4月3日星期二 UTC+8下午1時38分57秒寫道: > On Mon, Apr 2, 2018 at 9:01 PM, wrote: > > def run_forever(self): > """Run until stop() is called.""" >try: > events._set_running_loop(self) > while True: > self._run_once() >

Re: In asyncio, does the event_loop still running after run_until_complete returned?

2018-04-03 Thread Steven D'Aprano
On Mon, 02 Apr 2018 23:37:51 -0600, Ian Kelly wrote: > If it helps to demystify things, here is a simplified version of what > run_until_complete actually does: > > def run_until_complete(self, future): > """Run until the Future is done. > > If the argument is a coroutine,

Re: In asyncio, does the event_loop still running after run_until_complete returned?

2018-04-02 Thread Ian Kelly
On Mon, Apr 2, 2018 at 9:01 PM, wrote: > I also do a quick check, with call_later delay keeps at 1.5, to see what the > event loop status is after run_until_complete returns. Strangely, both > is_closed and is_running return a False. > > try: >

Re: In asyncio, does the event_loop still running after run_until_complete returned?

2018-04-02 Thread jfong
Ian於 2018年4月2日星期一 UTC+8下午9時37分08秒寫道: > On Mon, Apr 2, 2018 at 5:32 AM, wrote: > > I am new to the asyncio subject, just trying to figure out how to use it. > > Below is the script I use for testing: > > - > > # asyncio_cancel_task2.py > > > >

Re: In asyncio, does the event_loop still running after run_until_complete returned?

2018-04-02 Thread Ian Kelly
On Mon, Apr 2, 2018 at 5:32 AM, wrote: > I am new to the asyncio subject, just trying to figure out how to use it. > Below is the script I use for testing: > - > # asyncio_cancel_task2.py > > import asyncio > > @asyncio.coroutine > def

In asyncio, does the event_loop still running after run_until_complete returned?

2018-04-02 Thread jfong
I am new to the asyncio subject, just trying to figure out how to use it. Below is the script I use for testing: - # asyncio_cancel_task2.py import asyncio @asyncio.coroutine def task_func(): print('in task_func, sleeping') try: yield from