On Tue, Aug 9, 2016 at 7:13 AM, Nick Coghlan <[email protected]> wrote:

>
> On 9 August 2016 at 13:27, Guido van Rossum <[email protected]> wrote:
>
>> 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).
>>
>
> 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 :)
>

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.

-- 
--Guido van Rossum (python.org/~guido)
_______________________________________________
Python-ideas mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to