Skip to content

doc: add unref for input in readline - #38019

Merged
aduh95 merged 1 commit into
nodejs:masterfrom
AnupamaP:readline-doc-edit
Apr 3, 2021
Merged

doc: add unref for input in readline#38019
aduh95 merged 1 commit into
nodejs:masterfrom
AnupamaP:readline-doc-edit

Conversation

@AnupamaP

@AnupamaPAnupamaP commented Apr 1, 2021

Copy link
Copy Markdown
Contributor

Fixes: #36154

@nodejs-github-botnodejs-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
AnupamaPforce-pushed the readline-doc-edit branch 3 times, most recently from 5921b8f to a5fe4a9CompareApril 1, 2021 13:18

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

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

@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
Copy Markdown
Member

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

AnupamaP commented Apr 1, 2021

Copy link
Copy Markdown
ContributorAuthor

@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);

Comment threaddoc/api/readline.md Outdated
@aduh95

Copy link
Copy Markdown
Contributor

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.

Comment threaddoc/api/readline.md Outdated
Comment threaddoc/api/readline.md Outdated
Comment threaddoc/api/readline.md Outdated
Comment threaddoc/api/readline.md Outdated
Comment threaddoc/api/readline.md Outdated
Comment threaddoc/api/readline.md Outdated
Comment threaddoc/api/readline.md Outdated
@aduh95aduh95 added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 2, 2021
PR-URL: nodejs#38019Fixes: nodejs#36154
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
@aduh95
aduh95force-pushed the readline-doc-edit branch from ced82e4 to 7980d7cCompareApril 3, 2021 17:55
@aduh95

Copy link
Copy Markdown
Contributor

Landed in 7980d7c

@aduh95
aduh95 merged commit 7980d7c into nodejs:masterApr 3, 2021
MylesBorins pushed a commit that referenced this pull request Apr 4, 2021
PR-URL: #38019Fixes: #36154
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
@MylesBorinsMylesBorins mentioned this pull request Apr 4, 2021
MylesBorins pushed a commit that referenced this pull request Apr 5, 2021
PR-URL: #38019Fixes: #36154
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
targos pushed a commit that referenced this pull request May 1, 2021
PR-URL: #38019Fixes: #36154
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
@danielleadamsdanielleadams mentioned this pull request May 3, 2021
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.docIssues and PRs related to the documentations.readlineIssues 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

@AnupamaP@RaisinTen@aduh95@nodejs-github-bot