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

doc: add unref for input in readline #38019

Merged
merged 1 commit into from
Apr 3, 2021

Conversation

AnupamaP
Copy link
Contributor

@AnupamaP AnupamaP commented Apr 1, 2021

Fixes: #36154

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. readline Issues and PRs related to the built-in readline module. labels Apr 1, 2021
@AnupamaP AnupamaP force-pushed the readline-doc-edit branch 3 times, most recently from 5921b8f to a5fe4a9 Compare April 1, 2021 13:18
Copy link
Contributor

@RaisinTen RaisinTen left a comment

Choose a reason for hiding this comment

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

Thanks for making the PR. :)
Could you please address this review comment from a previous PR attempt to fix the related issue: #36458 (comment)?

I'm not sure this warrants its own section. Seems like it should go in the section of whatever call might result in requiring the unref() call. It would be good to incorporate it into an existing section, I think.

nit: I think the commit message should say Fixes instead of Ref (but that can be fixed while landing).

@AnupamaP
Copy link
Contributor Author

AnupamaP commented Apr 1, 2021

@RaisinTen - Thanks for the review!

Could you please address this review comment from a previous PR attempt to fix the related issue: #36458 (comment)?

I did incorporate the edits into an existing section instead of making a new section i.e. readline.createInterface(options) section. Am I missing something else?

@RaisinTen
Copy link
Contributor

The wait on the readable stream can also be ended by these calls:

readable.destroy();
readable.pause();
readable.unshift(null);

Should we also document these here?
IMO adding docs for these here seems a little out of place as they are already documented at https://nodejs.org/api/stream.html#stream_class_stream_readable. I think it would be more appropriate if we could mention this group of calls which can end the wait on the readable stream in the readable stream docs itself instead of everywhere an instance of the Readable class is used.

@AnupamaP
Copy link
Contributor Author

AnupamaP commented Apr 1, 2021

@RaisinTen Sure, we could do it in both places (readable and readline). Do you think it makes sense to add the following in the readable section? I can make that change

The wait on the readable stream can also be ended by these calls:
readable.destroy();
readable.pause();
readable.unshift(null);

doc/api/readline.md Outdated Show resolved Hide resolved
@aduh95
Copy link
Contributor

aduh95 commented Apr 1, 2021

The wait on the readable stream can also be ended by these calls:
Should we also document these here?

FWIW I don't think it's necessary: I think it's irrelevant to a user trying to interface with stdin that there are several ways to "make the program not hang". We don't have to be thorough on how the stream API work in the readline API documentation.

doc/api/readline.md Outdated Show resolved Hide resolved
doc/api/readline.md Outdated Show resolved Hide resolved
doc/api/readline.md Outdated Show resolved Hide resolved
doc/api/readline.md Outdated Show resolved Hide resolved
doc/api/readline.md Outdated Show resolved Hide resolved
doc/api/readline.md Outdated Show resolved Hide resolved
doc/api/readline.md Outdated Show resolved Hide resolved
@aduh95 aduh95 added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 2, 2021
@aduh95
Copy link
Contributor

aduh95 commented Apr 3, 2021

Landed in 7980d7c

@aduh95 aduh95 merged commit 7980d7c into nodejs:master Apr 3, 2021
MylesBorins pushed a commit that referenced this pull request Apr 4, 2021
PR-URL: #38019
Fixes: #36154
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Apr 4, 2021
MylesBorins pushed a commit that referenced this pull request Apr 5, 2021
PR-URL: #38019
Fixes: #36154
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
targos pushed a commit that referenced this pull request May 1, 2021
PR-URL: #38019
Fixes: #36154
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
@danielleadams danielleadams mentioned this pull request May 3, 2021
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. doc Issues and PRs related to the documentations. readline Issues and PRs related to the built-in readline module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to unref readline?
4 participants