One option might be something like https://github.com/rbuckton/prex/blob/master/docs/scheduling.md#class-asyncqueue. It allows you to put items on the queue as soon as they are available.
Ron From: Naveen Chawla<mailto:[email protected]> Sent: Saturday, July 29, 2017 3:54 AM To: Domenic Denicola<mailto:[email protected]>; [email protected]<mailto:[email protected]> Subject: Re: Stream + async await Interesting!!! 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 <[email protected]<mailto:[email protected]>> wrote: https://github.com/tc39/proposal-async-iteration<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftc39%2Fproposal-async-iteration&data=04%7C01%7Cron.buckton%40microsoft.com%7C90d8f33f560d48305ad808d4d6703ae6%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636369224897437474%7CUnknown%7CVW5rbm93bnx7IlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiT3RoZXIifQ%3D%3D%7C-1&sdata=QxOturJl0rd7nIv2%2Fy2MVAiVCVF2sd8arppSGIFiV9k%3D&reserved=0> From: es-discuss [mailto:[email protected]<mailto:[email protected]>] On Behalf Of Naveen Chawla Sent: Tuesday, July 11, 2017 09:24 To: [email protected]<mailto:[email protected]> Subject: Stream + async await It'd be great to have async stream constructs such as: http://reactivex.io/rxjs/<https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Freactivex.io%2Frxjs%2F&data=04%7C01%7Cron.buckton%40microsoft.com%7C90d8f33f560d48305ad808d4d6703ae6%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636369224897437474%7CUnknown%7CVW5rbm93bnx7IlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiT3RoZXIifQ%3D%3D%7C-1&sdata=WlsRBdhN2hkFpFcQ6zJK846k31TYWog91myIwiw02ow%3D&reserved=0> , 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).
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

