[Python-Dev] async/await in Python; v2

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Apr 23 14:18:50 CEST 2015


Paul Sokolovsky wrote:
> Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> 
>>You can also use a trampoline of some kind to
>>relay values back and forth between generators,
>>to get something symmetric.
> 
> Yes, that's of course how coroutine frameworks were done long before
> "yield from" appeared and how Trollius works now.

No, what I mean is that if you want to send stuff
back and forth between two particular coroutines in
a symmetric way, you can write a specialised
scheduler that just handles those coroutines.

If you want to do that at the same time that other
things are going on, I think you're better off
not trying to do it using yield. Use a general
scheduler such as asyncio, and some traditional
IPC mechanism such as a queue for communication.

-- 
Greg


More information about the Python-Dev mailing list