async enumeration - possible?

Marko Rauhamaa marko at pacujo.net
Wed Nov 30 04:28:27 EST 2016


"Frank Millman" <frank at chagford.com>:

> "Marko Rauhamaa"  wrote in message news:87d1hd4d5k.fsf at elektro.pacujo.net...
>>   I don't think bulk iteration in asynchronous programming is ever that
>>   great of an idea. You want to be prepared for more than one possible
>>   stimulus in any given state. IOW, a state machine matrix might be
>>   sparse but it is never diagonal.
>
> [...]
>
> I use 'bulk iteration' a lot in my app. It is a client/server
> multi-user business/accounting app.
>
> If a user wants to view the contents of a large table, or I want to
> print statements for a lot of customers, I can request the data and
> process it as it arrives, without blocking the other users.

Each "await" in a program is a (quasi-)blocking state. In each state,
the program needs to be ready to process different input events.

I suppose there are cases where a coroutine can pursue an objective
single-mindedly (in which case the only secondary input event is the
cancellation of the operation). I have done quite a bit of asynchronous
programming but never run into that scenario yet.


Marko



More information about the Python-list mailing list