File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -594,10 +594,11 @@ it'll pause once again and hand control back to the event loop.
594594
595595Once enough time has elapsed, ``_sleep_watcher(...) `` marks the future as
596596done and completes by exiting its infinite ``while `` loop.
597- In the process of marking the future as done, the future's list of callbacks,
598- namely to resume the ``async_sleep(3) `` coroutine, are added to the event loop.
599- Some time later, the event loop will resume that coroutine and the program will
600- proceed in the ``main() `` coroutine.
597+ Marking the future as done adds its list of callbacks, namely to resume the
598+ ``async_sleep(3) `` coroutine, to the event loop.
599+ Some time later, the event loop resumes that coroutine.
600+ Since there are no further instructions (the last one was ``await future ``),
601+ it too finishes and returns to ``main() `` where the program proceeds.
601602Given this helper task is only invoked once per cycle of the event loop,
602603you'd be correct to note that this asynchronous sleep will sleep *at least *
603604three seconds, rather than exactly three seconds.
You can’t perform that action at this time.
0 commit comments