Stream + async await

Ron Buckton Ron.Buckton at
Sat Jul 29 21:21:36 UTC 2017

One option might be something like It allows you to put items on the queue as soon as they are available.


From: Naveen Chawla<mailto:naveen.chwl at>
Sent: Saturday, July 29, 2017 3:54 AM
To: Domenic Denicola<mailto:d at>; es-discuss at<mailto:es-discuss at>
Subject: Re: Stream + async await


Excuse my ignorance, but with this construct, how would you trivially invoke a "publish" ahead of any given "consumption"?

As far as I can see,

for await (const item of requestItems){

on its own is purely a "front-pressure" construct. That is, each request is made upon the completion and satisfactory consumption of the last one.

Can you suggest a way to trivially invoke some "back pressure" using this construct? By this I mean - invoke extra requests before they come to be consumed (like you can do with reactive streaming libraries). An example use would be if you wanted to do some "eager loading" of data while the user is likely to be viewing but not currently interacting with existing content, for example.

You seem very familiar with this construct, so I wouldn't be surprised if you've already thought about this! (If you're too busy I'm sure there are others here familiar with it too!)

On Tue, 11 Jul 2017 at 21:09 Domenic Denicola <d at<mailto:d at>> wrote:<>

From: es-discuss [mailto:es-discuss-bounces at<mailto:es-discuss-bounces at>] On Behalf Of Naveen Chawla
Sent: Tuesday, July 11, 2017 09:24
To: es-discuss at<mailto:es-discuss at>
Subject: Stream + async await

It'd be great to have async stream constructs such as:<> , supported natively, such that they can be used directly with the async / await keywords for async stream programming in a linear fashion (analogous to what can already be done with linearly awaiting Promises, but for async streams instead).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list