FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

stream: add pipeline() for webstreams by debadree25 · Pull Request #46307 · nodejs/node · GitHub

/ node Public

stream: add pipeline() for webstreams - #46307

Merged
nodejs-github-bot merged 26 commits into
nodejs:mainfrom
debadree25:ft/pipeline-webstreams
Feb 2, 2023
Merged

stream: add pipeline() for webstreams#46307
nodejs-github-bot merged 26 commits into
nodejs:mainfrom
debadree25:ft/pipeline-webstreams

Conversation

Copy link
Copy Markdown
Contributor

Added support to using pipeline() for webstreams and added tests for both webstreams and mixture of node streams and webstreams with pipeline

Refs: #39316

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/streams

nodejs-github-bot added the needs-ci PRs that need a full CI run. label Jan 22, 2023

ronag left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I would prefer if we could avoid transforming into node stream

Copy link
Copy Markdown
Contributor Author

I would prefer if we could avoid transforming into node stream

Any suggestion what alternative you would prefer?

ronag commented Jan 22, 2023

Copy link
Copy Markdown
Member

I would prefer if we could avoid transforming into node stream

Any suggestion what alternative you would prefer?

What I wrote 😄. We don't convert generators to streams. Instead we have a custom function pumping.

Copy link
Copy Markdown
Contributor Author

I would prefer if we could avoid transforming into node stream

Any suggestion what alternative you would prefer?

What I wrote 😄. We don't convert generators to streams. Instead we have a custom function pumping.

Ah ok yes 😅😅, I think could try using pipeThrough of readable streams, converting the PR to draft

debadree25 marked this pull request as draft January 22, 2023 14:03

Copy link
Copy Markdown
Contributor Author

Ok this requires some work closing this for now will reopen with fresh version 😅😅

debadree25 closed this Jan 22, 2023
debadree25 reopened this Jan 22, 2023

Copy link
Copy Markdown
Contributor Author

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

  1. If the pipeline consists entirely of webstreams we could ensure that webstream native methods like pipeThrough, pipeTo is used
  2. If there is interop between webstreams and node streams we could allow this Duplex interop to continue?

would this be an acceptable path?

debadree25 commented Jan 25, 2023
edited
Loading

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Member

Just took a very quick look but it seems to be right general direction.

debadree25 marked this pull request as ready for review January 26, 2023 14:49
debadree25 marked this pull request as draft January 26, 2023 14:49

Copy link
Copy Markdown
Contributor Author

Reopening for review all the tests passing!

debadree25 marked this pull request as ready for review January 26, 2023 16:10
debadree25 requested a review from ronag January 26, 2023 16:10

ronag left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I would make two separate pump functions.

Copy link
Copy Markdown
Contributor Author

Ok refactoring

Copy link
Copy Markdown
Contributor Author

I would make two separate pump functions.

The code would be duplicated no?

Copy link
Copy Markdown
Contributor Author

Have updated to use a separate function

debadree25 requested a review from ronag January 26, 2023 18:48

mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

lgtm

mcollina added the request-ci Add this label to start a Jenkins CI on a PR. label Jan 29, 2023
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 29, 2023

Copy link
Copy Markdown
Collaborator

});
const ws = new WritableStream({
write(chunk) {
values.push(chunk?.toString());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Nit: since the test is only pushing strings through, perhaps just simply values.push(chunk) ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

sure updating

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Fixed

ronag added stream Issues and PRs related to the stream subsystem. author ready PRs that have at least one approval, no outstanding review comments, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. web streams and removed needs-ci PRs that need a full CI run. labels Jan 30, 2023
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 30, 2023

Copy link
Copy Markdown
Collaborator

lpinca added commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. commit-queue Add this label to land a pull request using GitHub Actions. labels Feb 2, 2023
nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Feb 2, 2023
nodejs-github-bot merged commit 23effb2 into nodejs:main Feb 2, 2023

Copy link
Copy Markdown
Collaborator

Landed in 23effb2

Copy link
Copy Markdown
Contributor Author

This one had taken quite some trial and error!
Thank you to all reviewers for your time and patience!

MylesBorins pushed a commit that referenced this pull request Feb 18, 2023
Refs: #39316
PR-URL: #46307
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
MylesBorins mentioned this pull request Feb 19, 2023
debadree25 added a commit to debadree25/node that referenced this pull request Feb 27, 2023
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>
danielleadams pushed a commit that referenced this pull request Apr 11, 2023
Refs: #39316
PR-URL: #46307
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. stream Issues and PRs related to the stream subsystem. web streams

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants


Back | FazBrowse Home | New Git URL