Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.4k
stream: add pipeline() for webstreams#46307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stream: add pipeline() for webstreams #46307
Uh oh!
There was an error while loading. Please reload this page.
Conversation
nodejs-github-bot commented Jan 22, 2023
Review requested:
|
ronag left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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? |
debadree25 commented Jan 25, 2023 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
ronag left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
mcollina left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
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.
| }); | ||
| constws=newWritableStream({ | ||
| write(chunk){ | ||
| values.push(chunk?.toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: since the test is only pushing strings through, perhaps just simply values.push(chunk) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure updating
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
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: #39316 PR-URL: #46307 Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
Refs: nodejs#39316 PR-URL: nodejs#46307 Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
Refs: nodejs#39316 PR-URL: nodejs#46307 Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
Refs: #39316 PR-URL: #46307 Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
Added support to using pipeline() for webstreams and added tests for both webstreams and mixture of node streams and webstreams with pipeline
Refs: #39316