In asyncio, does the event_loop still running after run_until_complete returned?
steve+comp.lang.python at pearwood.info
Tue Apr 3 22:28:46 EDT 2018
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, it is wrapped in a Task.
> Return the Future's result, or raise its exception. """
Demystify, he says.
Future, he says. Coroutine. Task. What's self? What's tasks? What's
events? Enquiring minds want to know.
> future = tasks.ensure_future(future, loop=self)
> return future.result()
> def run_forever(self):
> """Run until stop() is called."""
That's obviously a different meaning to the word "forever" than I learnt
More information about the Python-list