Skip to content

fs,net: standardize pending stream property - #24067

Closed
addaleax wants to merge 3 commits into
nodejs:masterfrom
addaleax:pending-all-the-things
Closed

fs,net: standardize pending stream property#24067
addaleax wants to merge 3 commits into
nodejs:masterfrom
addaleax:pending-all-the-things

Conversation

@addaleax

Copy link
Copy Markdown
Member

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.
@addaleaxaddaleax 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

Copy link
Copy Markdown
Collaborator

@nodejs-github-botnodejs-github-bot added dont-land-on-v6.x http2 Issues or PRs related to the http2 subsystem. labels Nov 3, 2018
Comment threaddoc/api/fs.md Outdated
Comment threaddoc/api/net.md Outdated
Comment threadlib/net.js
@addaleax

Copy link
Copy Markdown
MemberAuthor

@mscdex Done, addressed all 3 comments.

Comment threadlib/internal/fs/streams.js Outdated
Comment threadtest/parallel/test-fs-ready-event-stream.js Outdated
Comment threadtest/parallel/test-fs-ready-event-stream.js Outdated
Comment threadtest/parallel/test-net-connect-buffer.js
@addaleax

Copy link
Copy Markdown
MemberAuthor

@lpinca Thanks for catching those, done!

Comment threaddoc/api/fs.md
`readStream.path` will be a string. If `path` is passed as a `Buffer`, then
`readStream.path` will be a `Buffer`.

### readStream.pending

@sindresorhussindresorhusNov 5, 2018

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
MemberAuthor

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
Copy Markdown
MemberAuthor

Any other thoughts/reviewers?

@addaleax

Copy link
Copy Markdown
MemberAuthor

@addaleaxaddaleax 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
Copy Markdown
MemberAuthor

@Trott

Copy link
Copy Markdown
Member

@Trott

Copy link
Copy Markdown
Member

Landed in 0e06b35

@TrottTrott 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>
@BridgeARBridgeAR mentioned this pull request Nov 15, 2018
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>
@BethGriggsBethGriggs 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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.fsIssues and PRs related to the fs subsystem / file system.http2Issues or PRs related to the http2 subsystem.netIssues and PRs related to the net subsystem.semver-minorPRs 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

@addaleax@nodejs-github-bot@Trott@mscdex@sindresorhus@jasnell@lpinca@JungMinu