|
|
|
|
|
by jonathaneunice
3916 days ago
|
|
I did not understand the highly synchronous, sequential, blocking behavior of the code examples. That would absolutely make the events example not work. Or is it implicit that an asynchronous operation would replace today's blocking `next()`? That `itertools.consume()` or the final `next()` would provide an async upgrade, similar to the way Unix's `select()` works? That was never explicitly mentioned...but is the only way this pattern would make larger sense / scale usefully. |
|
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.