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

fs,net: standardize pending stream property #24067

Closed
wants to merge 3 commits into from

Conversation

addaleax
Copy link
Member

@addaleax addaleax commented Nov 3, 2018

Use the same property name as http2 does to indicate that
the stream is in the state before the ready event is emitted.

(This is semver-minor. If people feel that we should absolutely not have this in our public API, I’m probably going to incorporate this into a later PR using a Symbol rather than an “official” property.)

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

Use the same property name as http2 does to indicate that
the stream is in the state before the `ready` event is emitted.
@addaleax addaleax added fs Issues and PRs related to the fs subsystem / file system. net Issues and PRs related to the net subsystem. semver-minor PRs that contain new features and should be released in the next minor version. labels Nov 3, 2018
@nodejs-github-bot nodejs-github-bot added dont-land-on-v6.x http2 Issues or PRs related to the http2 subsystem. labels Nov 3, 2018
doc/api/fs.md Outdated Show resolved Hide resolved
doc/api/net.md Outdated Show resolved Hide resolved
lib/net.js Show resolved Hide resolved
@addaleax
Copy link
Member Author

addaleax commented Nov 3, 2018

@mscdex Done, addressed all 3 comments.

lib/internal/fs/streams.js Outdated Show resolved Hide resolved
test/parallel/test-fs-ready-event-stream.js Outdated Show resolved Hide resolved
test/parallel/test-fs-ready-event-stream.js Outdated Show resolved Hide resolved
test/parallel/test-net-connect-buffer.js Show resolved Hide resolved
@addaleax
Copy link
Member Author

addaleax commented Nov 3, 2018

@lpinca Thanks for catching those, done!

@@ -488,6 +488,16 @@ argument to `fs.createReadStream()`. If `path` is passed as a string, then
`readStream.path` will be a string. If `path` is passed as a `Buffer`, then
`readStream.path` will be a `Buffer`.

### readStream.pending
Copy link

@sindresorhus sindresorhus Nov 5, 2018

Choose a reason for hiding this comment

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

Would be better to name this .isPending. When you read .pending, it could either mean it contains a pending object or a boolean of whether it's pending. That's not clear from just reading the code.

Copy link
Contributor

Choose a reason for hiding this comment

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

.pending I think fits the style of other pre-existing properties like .connecting

Copy link
Member Author

Choose a reason for hiding this comment

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

It’s also what HTTP/2 already uses for this purpose…

@addaleax
Copy link
Member Author

addaleax commented Nov 7, 2018

Any other thoughts/reviewers?

@addaleax
Copy link
Member Author

@addaleax addaleax added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Nov 10, 2018
@addaleax
Copy link
Member Author

@Trott
Copy link
Member

Trott commented Nov 14, 2018

@Trott
Copy link
Member

Trott commented Nov 14, 2018

Landed in 0e06b35

@Trott Trott closed this Nov 14, 2018
Trott pushed a commit to Trott/io.js that referenced this pull request Nov 14, 2018
Use the same property name as http2 does to indicate that
the stream is in the state before the `ready` event is emitted.

PR-URL: nodejs#24067
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
BridgeAR pushed a commit that referenced this pull request Nov 14, 2018
Use the same property name as http2 does to indicate that
the stream is in the state before the `ready` event is emitted.

PR-URL: #24067
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
kiyomizumia pushed a commit to kiyomizumia/node that referenced this pull request Nov 15, 2018
Use the same property name as http2 does to indicate that
the stream is in the state before the `ready` event is emitted.

PR-URL: nodejs#24067
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
BridgeAR pushed a commit that referenced this pull request Nov 15, 2018
Use the same property name as http2 does to indicate that
the stream is in the state before the `ready` event is emitted.

PR-URL: #24067
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
BethGriggs pushed a commit that referenced this pull request Apr 17, 2019
Use the same property name as http2 does to indicate that
the stream is in the state before the `ready` event is emitted.

PR-URL: #24067
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
BethGriggs pushed a commit that referenced this pull request Apr 28, 2019
Use the same property name as http2 does to indicate that
the stream is in the state before the `ready` event is emitted.

PR-URL: #24067
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@BethGriggs BethGriggs mentioned this pull request May 1, 2019
MylesBorins pushed a commit that referenced this pull request May 16, 2019
Use the same property name as http2 does to indicate that
the stream is in the state before the `ready` event is emitted.

PR-URL: #24067
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
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. fs Issues and PRs related to the fs subsystem / file system. http2 Issues or PRs related to the http2 subsystem. net Issues and PRs related to the net subsystem. semver-minor PRs that contain new features and should be released in the next minor version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants