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
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()
>
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,
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:
>
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
> >
> >
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
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