Uh oh!
There was an error while loading. Please reload this page.
stream: add pipeline() for webstreams - #46307
Conversation
nodejs-github-bot
commented
Jan 22, 2023
Review requested:
|
ronag
left a comment
There was a problem hiding this comment.
I would prefer if we could avoid transforming into node stream
debadree25
commented
Jan 22, 2023
Any suggestion what alternative you would prefer? |
ronag
commented
Jan 22, 2023
What I wrote 😄. We don't convert generators to streams. Instead we have a custom function pumping. |
debadree25
commented
Jan 22, 2023
Ah ok yes 😅😅, I think could try using pipeThrough of readable streams, converting the PR to draft |
debadree25
commented
Jan 22, 2023
Ok this requires some work closing this for now will reopen with fresh version 😅😅 |
debadree25
commented
Jan 22, 2023
Hi @ronag we are in an interesting position in regards to this PR turns out pipeline already supports webstreams due to #46307 since the pipeline is converting streams to duplexes and duplex now supports webstreams, except it breaks if transform streams are added in between, so I am thinking could do two things
would this be an acceptable path? |
Hello, have updated the code, 3 tests are failing which shall fix in a while but generally have updated to not convert everything to nodestreams 😅😅, could you please take a look again @ronag if the general direction seems to be correct? |
ronag
commented
Jan 26, 2023
Just took a very quick look but it seems to be right general direction. |
debadree25
commented
Jan 26, 2023
Reopening for review all the tests passing! |
ronag
left a comment
There was a problem hiding this comment.
I would make two separate pump functions.
debadree25
commented
Jan 26, 2023
Ok refactoring |
debadree25
commented
Jan 26, 2023
The code would be duplicated no? |
debadree25
commented
Jan 26, 2023
Have updated to use a separate function |
nodejs-github-bot
commented
Jan 29, 2023
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| }); | ||
| const ws = new WritableStream({ | ||
| write(chunk) { | ||
| values.push(chunk?.toString()); |
There was a problem hiding this comment.
Nit: since the test is only pushing strings through, perhaps just simply values.push(chunk) ?
nodejs-github-bot
commented
Jan 30, 2023
nodejs-github-bot
commented
Feb 2, 2023
Landed in 23effb2 |
debadree25
commented
Feb 2, 2023
This one had taken quite some trial and error! |
Refs: nodejs#39316 PR-URL: nodejs#46307 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Added support to using pipeline() for webstreams and added tests for both webstreams and mixture of node streams and webstreams with pipeline
Refs: #39316