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

doc: stdout, stderr and stdin are all Duplex streams by seppevs · Pull Request #11194 · nodejs/node · GitHub

/ node Public

doc: stdout, stderr and stdin are all Duplex streams - #11194

Closed
seppevs wants to merge 1 commit into
nodejs:masterfrom
seppevs:docs_stdout_stderr_and_stdin_are_duplex_streams
Closed

doc: stdout, stderr and stdin are all Duplex streams#11194
seppevs wants to merge 1 commit into
nodejs:masterfrom
seppevs:docs_stdout_stderr_and_stdin_are_duplex_streams

Conversation

seppevs commented Feb 6, 2017

Copy link
Copy Markdown
Contributor

doc: stdout, stderr and stdin are all Duplex streams but documentation states otherwise

This is a fix for #9201

Checklist
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

doc

nodejs-github-bot added doc Issues and PRs related to the documentations. process Issues and PRs related to the process subsystem. labels Feb 6, 2017

jasnell commented Feb 6, 2017

Copy link
Copy Markdown
Member

I'm not convinced that we should document these as Duplex and it's not entirely clear if that's always going to be the case. For instance, it does not make sense to treat stdin as a Writable.

addaleax commented Feb 6, 2017

Copy link
Copy Markdown
Member

For instance, it does not make sense to treat stdin as a Writable.

Just for clarification, that stdin is a “readable” stream and stdout/stderr are “writable” streams is only a convention and not enforced by the OS in any way (at least on UNIX and I think it applies to Windows, too).

I don’t think it’s Node’s place to enforce these convention when the OS doesn’t.

jasnell commented Feb 6, 2017

Copy link
Copy Markdown
Member

True, but it's also not that practically useful unless there's an obscure use case I'm missing.

Fishrock123 commented Feb 6, 2017
edited
Loading

Copy link
Copy Markdown
Contributor

True, but it's also not that practically useful unless there's an obscure use case I'm missing.

Maybe we could start printing warnings to fd 0. 😛

The docs are still technically correct due to the weirdness that is the stdio impl.

I think changing it to note that it is net.Socket (inherits from stream.Duplex) unless it is from/to a file, in which case it is a fs.sync{Write|Read}Stream, could be more useful.

jasnell commented Feb 6, 2017

Copy link
Copy Markdown
Member

That would be certainly more useful

Copy link
Copy Markdown
Contributor

Just because it may not be used very often doesn't mean its not useful. Why should we have an opinion on this, particularly if its platform independent, and pre-existing? There are interesting use-cases, like gpg, where processes read and write from arbitrary fds, I like that such programs can be written in node, that its not just for webapps.

Copy link
Copy Markdown
Contributor

Agree with #11194 (comment), we should doc its actual class.

seppevs force-pushed the docs_stdout_stderr_and_stdin_are_duplex_streams branch from 30d6058 to 5a00980 Compare February 13, 2017 09:51

seppevs commented Feb 13, 2017

Copy link
Copy Markdown
Contributor Author

I've amended changes to the commit so the actual class is now documented.

Fishrock123 self-assigned this Feb 14, 2017

sam-github left a comment

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.

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

I left some suggestions, I find the "from/to" confusing, but basically LGTM.

Comment thread doc/api/process.md Outdated

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.

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

I suggest: "unless fd 2 refers to a file, "

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

@sam-github Thank you for reviewing. I made the requested changes and rebased with master. I had some merge conflicts on the same sections in the docs.
Can you review again? Thanks!

Comment thread doc/api/process.md Outdated

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.

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

"(which inherits"

seppevs force-pushed the docs_stdout_stderr_and_stdin_are_duplex_streams branch 2 times, most recently from b78f255 to a7b5e61 Compare February 16, 2017 20:00

Copy link
Copy Markdown
Contributor

code looks good, @Fishrock123 assigned this to himself, so he'll need a chance to review

you should shorten your commit message, guidelines are here: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md#step-3-commit

jasnell 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

Almost there, small nit

Comment thread doc/api/process.md Outdated

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

It would be worthwhile to have this (and the other reference below) be a link to the Duplex doc

seppevs force-pushed the docs_stdout_stderr_and_stdin_are_duplex_streams branch from a7b5e61 to d5793b7 Compare February 17, 2017 08:15

seppevs commented Feb 17, 2017

Copy link
Copy Markdown
Contributor Author

@jasnell: I made the changes, can you review again?

Fishrock123 left a comment

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.

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

LGTM with one small comment

Comment thread doc/api/process.md Outdated

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.

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

Could you link net.Socket to it's definition in net.md? Thanks!

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

seppevs force-pushed the docs_stdout_stderr_and_stdin_are_duplex_streams branch from d5793b7 to a2f9c82 Compare February 22, 2017 09:39

fhinkel commented Mar 26, 2017

Copy link
Copy Markdown
Contributor

@seppevs sorry this took so long, by now process.md has changed. Can you rebase and make [Duplex] look like the other entries? Thanks!

seppevs force-pushed the docs_stdout_stderr_and_stdin_are_duplex_streams branch from a2f9c82 to b3a6a25 Compare March 27, 2017 07:39

seppevs commented Mar 27, 2017

Copy link
Copy Markdown
Contributor Author

@fhinkel done!

fhinkel pushed a commit that referenced this pull request Mar 27, 2017
stdout, stderr and stdin are all Duplex streams but documentation
states otherwise

Fixes #9201

PR-URL: #11194
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>

aqrln commented Mar 27, 2017

Copy link
Copy Markdown
Contributor

@cjihrig just for the record, this patch had been landed in 1005b1d before your approval.
@fhinkel was this an accidental push or you just forgot to close the PR?

Copy link
Copy Markdown
Contributor

Looks like she forgot to close it. Please re-open if this was in error.

MylesBorins pushed a commit that referenced this pull request Mar 28, 2017
stdout, stderr and stdin are all Duplex streams but documentation
states otherwise

Fixes #9201

PR-URL: #11194
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
MylesBorins mentioned this pull request Mar 28, 2017
italoacasas mentioned this pull request Apr 10, 2017
2 tasks
MylesBorins pushed a commit that referenced this pull request Apr 18, 2017
stdout, stderr and stdin are all Duplex streams but documentation
states otherwise

Fixes #9201

PR-URL: #11194
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>

Copy link
Copy Markdown
Contributor

backported to v6.x-staging. If it should be backed out lmk

MylesBorins pushed a commit that referenced this pull request Apr 19, 2017
stdout, stderr and stdin are all Duplex streams but documentation
states otherwise

Fixes #9201

PR-URL: #11194
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
MylesBorins mentioned this pull request Apr 19, 2017
andrew749 pushed a commit to michielbaird/node that referenced this pull request Jul 19, 2017
stdout, stderr and stdin are all Duplex streams but documentation
states otherwise

Fixes nodejs/node#9201

PR-URL: nodejs/node#11194
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@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

doc Issues and PRs related to the documentations. process Issues and PRs related to the process subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants


Back | FazBrowse Home | New Git URL