proposal-async-iterator-helpers
proposal-async-iterator-helpers copied to clipboard
Methods for working with async iterators in ECMAScript
Wanted to write this down so I don't forget, though it won't be in the first version of this proposal. We should have a helper for merging or racing multiple...
These aren't strictly necessary given a `bufferAhead` helper, because you can always replace `.some(pred)` with `.map(pred).bufferAhead(3).some(x => x)` (or similar). But that's kind of gross. I definitely don't want to...
For the concurrency in the other helpers to be useful, you have to call `.next()` multiple times and buffer the results as they come in. We should have a helper...
I'm a little fuzzy on how this (or iterator helpers) will handle `undefined` returns. `Array#flatMap` will just add an `undefined` value to the output flattened array. I assume the same...
I think we should guarantee you get the same results in the same order as if you had made the calls sequentially (assuming no funny business in the mapper/iterator). To...
Hi, thanks for this extra proposal repo! I was not up to date that this was split into a separate proposal. I added an example back in 2021 to show...
As described in the `README.md`'s ["Concurrency" section](https://github.com/tc39/proposal-async-iterator-helpers/blob/5b621912db31d7d8e1df6690540f25bb3171a044/README.md#concurrency), and also as been discussed a lot across the [Add a buffering helper](https://github.com/tc39/proposal-async-iterator-helpers/issues/4) issue thread - the helpers are designed to NOT queue...
I looked for prior art in other languages and libraries and mostly came up empty. Python's async iterators aren't usable with its built-in global `map` and `filter` functions. There's [`imap`](https://docs.python.org/3/library/multiprocessing.html#multiprocessing.pool.Pool.imap),...
Consider: ```js asyncIteratorOfUrls .map(url => fetch(url)) .drop(3) .next(); ``` Should the first four fetches (the three dropped, and then one which will be returned) happen in parallel, or in sequence?...
As discussed in plenary. We should have variants of each of the iterator helpers that yield their results in an order that depends on the order of resolution of promises...