[Python-ideas] Are there asynchronous generators?

Nick Coghlan ncoghlan at gmail.com
Mon Jun 29 13:23:52 CEST 2015

On 29 Jun 2015 7:33 pm, "Guido van Rossum" <guido at python.org> wrote:
> Not following this in detail, but want to note that async isn't a good
model for parallelization (except I/O) because the expectation of
coroutines is single threading. The event loop serializes callbacks.
Changing this would break expectations and code.

Yeah, it's a bad idea - I realised after reading your post that because
submission for scheduling and waiting for a result can already be separated
it should be possible in Py 3.5 to write a "parallel" asynchronous iterator
that eagerly consumes the awaitables produced by another asynchronous
iterator, schedules them all, then produces the awaitables in order.

(That idea is probably as clear as mud without code to show what I mean...)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150629/c126631f/attachment.html>

More information about the Python-ideas mailing list