Skip to content
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: make readable & writable computed #31197

Closed
wants to merge 4 commits into from

Conversation

ronag
Copy link
Member

@ronag ronag commented Jan 5, 2020

This makes readable and writable automatically computed based
on the stream state.

Effectivly deprecating/discouraging manual management of this.

Makes the properties more consistent and easier to reason about.

Refs: #29377

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the stream Issues and PRs related to the stream subsystem. label Jan 5, 2020
@ronag

This comment has been minimized.

@ronag ronag force-pushed the stream-writable-computed branch 2 times, most recently from c55b3ca to e753f27 Compare January 5, 2020 20:12
@ronag ronag changed the title stream: Writable.writable computed stream: readable & writable computed Jan 5, 2020
@ronag ronag force-pushed the stream-writable-computed branch 6 times, most recently from e1bcd2a to c968c49 Compare January 5, 2020 21:06
@ronag
Copy link
Member Author

ronag commented Jan 5, 2020

ping @mcollina

@ronag
Copy link
Member Author

ronag commented Jan 5, 2020

semver-major

@lundibundi lundibundi added the semver-major PRs that contain breaking changes and should be released in the next major version. label Jan 5, 2020
@nodejs-github-bot
Copy link
Collaborator

@ronag

This comment has been minimized.

lib/_http_client.js Outdated Show resolved Hide resolved
lib/internal/http2/core.js Outdated Show resolved Hide resolved
@ronag ronag force-pushed the stream-writable-computed branch 10 times, most recently from 80ea96c to 52f36d0 Compare January 6, 2020 12:43
@ronag ronag added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. and removed wip Issues and PRs that are still a work in progress. labels Jan 31, 2020
@ronag
Copy link
Member Author

ronag commented Jan 31, 2020

@ronag
Copy link
Member Author

ronag commented Feb 1, 2020

Needs TSC review. @mcollina @jasnell @addaleax

doc/api/stream.md Outdated Show resolved Hide resolved
doc/api/stream.md Outdated Show resolved Hide resolved
lib/_stream_readable.js Show resolved Hide resolved
lib/_stream_writable.js Show resolved Hide resolved
@nodejs-github-bot
Copy link
Collaborator

@ronag ronag requested a review from lpinca February 1, 2020 12:24
Copy link
Member

@lpinca lpinca left a comment

Choose a reason for hiding this comment

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

Seems good to me.

test/parallel/test-stream-readable-readable.js Outdated Show resolved Hide resolved
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@addaleax addaleax removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Feb 7, 2020
@addaleax
Copy link
Member

addaleax commented Feb 7, 2020

This needs another @nodejs/tsc review

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm - I would prefer to hear from @mafintosh before landing, but we can go ahead.

@mafintosh
Copy link
Member

Lgtm from me also

@@ -495,7 +495,8 @@ added: v11.4.0

* {boolean}

Is `true` if it is safe to call [`writable.write()`][stream-write].
Is `true` if it is safe to call [`writable.write()`][stream-write], which means
the stream has not been destroyed, errored or ended.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
the stream has not been destroyed, errored or ended.
the stream has not been destroyed, errored, or ended.

Copy link
Member

Choose a reason for hiding this comment

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

^Non-blocking, in case that wasn't obvious. (FWIW, our Style Guide says to use serial commas.)

@Trott
Copy link
Member

Trott commented Feb 7, 2020

CITGM results look good.

Copy link
Member

@Trott Trott left a comment

Choose a reason for hiding this comment

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

LGTM with the streams subject-matter-expert approval that it has.

@ronag ronag added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Feb 8, 2020
@ronag
Copy link
Member Author

ronag commented Feb 8, 2020

Landed in e559842

@ronag ronag closed this Feb 8, 2020
ronag added a commit that referenced this pull request Feb 8, 2020
This makes readable and writable automatically computed based
on the stream state.

Effectivly deprecating/discouraging manual management of this.

Makes the properties  more consistent and easier to reason about.

Fixes: #29377

PR-URL: #31197
Refs: #29377
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
ronag added a commit to nxtedition/node that referenced this pull request Feb 15, 2020
A remainder from a previous refactoring.

Refs: nodejs#31197
@ronag ronag mentioned this pull request Feb 16, 2020
4 tasks
ronag added a commit that referenced this pull request Feb 17, 2020
A remainder from a previous refactoring.

Refs: #31197

PR-URL: #31805
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: James M Snell <[email protected]>
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 pending requests for changes, and a CI started. semver-major PRs that contain breaking changes and should be released in the next major version. stream Issues and PRs related to the stream subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.