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
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4