On Wed, Mar 27, 2019 at 10:44 AM Daniel Nugent <nug...@gmail.com> wrote:
>
> FWIW, the ayncio_run_encapsulated approach does not work with the 
> transport/protocol apis because the loop needs to stay alive concurrent with 
> the connection in order for the awaitables to all be on the same loop.

Yeah, there are two basic approaches being discussed here: using two
different loops, versus re-entering an existing loop.
asyncio_run_encapsulated is specifically for the two-loops approach.

In this version, the outer loop, and everything running on it, stop
entirely while the inner loop is running – which is exactly what
happens with any other synchronous, blocking API. Using
asyncio_run_encapsulated(aiohttp.get(...)) in Jupyter is exactly like
using requests.get(...), no better or worse.

-n

-- 
Nathaniel J. Smith -- https://vorpus.org
_______________________________________________
Async-sig mailing list
Async-sig@python.org
https://mail.python.org/mailman/listinfo/async-sig
Code of Conduct: https://www.python.org/psf/codeofconduct/

Reply via email to