| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
This is still missing:
In terms of API - I think this is what people are usually looking for when transforming a stream. Also cc @mcollina @nodejs/streams to make sure this isn't "under the radar". |
Sorry, something went wrong.
|
I think it's better to lift the implementation of mapIterator in https://github.com/mcollina/hwp/blob/main/index.js where also @ronag contributed. |
Sorry, something went wrong.
|
I don't understand the need for the double queueing here but I am happy to adjust the implementation. The actual API sounds good? |
Sorry, something went wrong.
The implementation in this PR processes chunks one by one, however this is problematic given it's an async function. If we do not support some level of parallel processing it's not going to be really useful because it would be too slow. |
Sorry, something went wrong.
|
Should we use hwp map? |
Sorry, something went wrong.
That sounds reasonable. So we agree on the API itself but it would be better if it mapd concurrently. I'm fine with hwp map as that implementation (can adjust the PR + add tests) :) I think we should slightly adjust the behavior:
WDYT? |
Sorry, something went wrong.
I think concurrency should be an option, not necessarily the default given that it would introduce non-deterministic ordering of the results. Options that would appear to make immediate sense here include:
const ac = new AbortController();
Readable.from([1, 2, 3, 4, 5]).map((x) => x + x, { concurrency: 5, signal: ac.signal });
|
Sorry, something went wrong.
That is incorrect. The implementation I recommended keep the ordering. |
Sorry, something went wrong.
|
@benjamingr I did some work on the PR. I hope you don't mind.
|
Sorry, something went wrong.
|
@ronag I don't, feel free, I am still in the conference aftermath here ^^ I'll try and push some docs :) |
Sorry, something went wrong.
There was a problem hiding this comment.
| } | |
| } | |
| stream.destroy(err); |
Should destroy back propagate to source stream?
Sorry, something went wrong.
There was a problem hiding this comment.
@devsnek does .return propagate in proposal-iterator-helpers?
That is, in that proposal:
const iter = getIterator();
const mapped = iter.map(x => x * 2);
mapped.return(); // is `.return` called on iter?
Sorry, something went wrong.
There was a problem hiding this comment.
@ronag did you resolve because you checked with that? Because I wanna make sure we align
Sorry, something went wrong.
There was a problem hiding this comment.
I resolved it because I added a destroy. It was before I saw your comment.
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM with a question
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
lgtm
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This is very much work in progress when meeting @ronag at NodeTLV.
This is based on the ongoing standards work in https://github.com/tc39/proposal-iterator-helpers in order to make Node.js more compatible with the language in the future.
In addition, people often really just want to map a stream and this provides a simpler API than compose or pipeline for simple cases.
This is still missing docs, I want to bikeshed the API and see we have consensus first.