<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Aug 9, 2016 at 7:13 AM, Nick Coghlan <span dir="ltr"><<a href="mailto:ncoghlan@gmail.com" target="_blank">ncoghlan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote"><span class="">On 9 August 2016 at 13:27, Guido van Rossum <span dir="ltr"><<a href="mailto:guido@python.org" target="_blank">guido@python.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Just don't oversell run_until_complete() -- some people coming from slightly different event loop paradigms expect to be able to pump for events at any point, possibly causing recursive invocations. That doesn't work here (and it's a feature it doesn't).<br></div></blockquote><div><br></div></span><div>Ah, interesting - I'd only ever used it for the "synchronous code that just wants this *particular* operation to run asynchronously in the current thread" case, which it handles nicely :)<br clear="all"></div></div></div></div></blockquote><div><br></div><div>It's really best reserved just for the main() function of an app. Anywhere else, you run the risk that your use of the event loop gets hidden in layers of other code (example: some logging backend that writes to a database) and eventually someone will call your function from an async callback or coroutine.<br></div></div><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div>
</div></div>