Re:Extending Python’s generators to support mainloops
by jonathaneunice on Tuesday October 06, 2015 @06:13PM
(#10342785)
If we're talking about a general purpose event provider/consumer API that takes into account that some event sources will be voluble, while others will be almost always silent/blocked, then that's a real upgrade. It could bring a real event-oriented capability to generators. You see bits and pieces of that now--attempts to use generators with greenlets and coroutines, say. But until the 3.4 asyncio work, GvR hasn't seemed sufficiently interested/invested to make a big step forward on event processing idioms. Now he is.
As for the `next()` and `consume()` approaches, yes, that would basically combine multiple generators in one and not block on any of them.
I will update the post with more information and also take into consideration all the work that has been done on asyncio module for Python3.4.