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

doc: Infinity for emitter.setMaxListeners by jasonkarns · Pull Request #2559 · nodejs/node · GitHub

/ node Public

doc: Infinity for emitter.setMaxListeners - #2559

Closed
jasonkarns wants to merge 2 commits into
nodejs:masterfrom
jasonkarns:document-emitter-setmaxlisteners-infinity
Closed

doc: Infinity for emitter.setMaxListeners#2559
jasonkarns wants to merge 2 commits into
nodejs:masterfrom
jasonkarns:document-emitter-setmaxlisteners-infinity

Conversation

Copy link
Copy Markdown
Member

Instead of recommending 0 as the magic value to set max listeners to unlimited, recommend Infinity.

This paves the way for 0 as a magic value eventually being deprecated and finally removed

original discussion: nodejs/node-v0.x-archive#22987
original PR: nodejs/node-v0.x-archive#25269

Instead of recommending `0` as the magic value to set max listeners to unlimited, recommend `Infinity`.

This paves the way for `0` as a magic value eventually being deprecated and finally removed

closes nodejs/node-v0.x-archive#22987

cjihrig commented Aug 26, 2015

Copy link
Copy Markdown
Contributor

LGTM

mscdex added the doc Issues and PRs related to the documentations. label Aug 26, 2015

targos commented Aug 26, 2015

Copy link
Copy Markdown
Member

LGTM, but I don't think we need to ever deprecate/remove the use of 0 as magic value. It is a common paradigm.

Copy link
Copy Markdown
Contributor

One problem with removing references to setMaxListeners(0) (in favor of Infinity) is that if someone sees that in code and wants to look at the docs to figure out what's going on, the docs won't have an answer for them. Would you be opposed to rewording that to Set to Infinity (or zero) for unlimited.?

Copy link
Copy Markdown
Member Author

@chrisdickinson I'm okay with documenting 0 for a while. Ideally the whole point of this is for people to move away from using 0 at all. But for a transitional period, it makes sense to keep the old pattern documented. wording updated

Copy link
Copy Markdown
Contributor

LGTM.

silverwind pushed a commit that referenced this pull request Oct 9, 2015
Instead of recommending `0` as the magic value to set max listeners to
unlimited, recommend `Infinity`. This paves the way for `0` as a magic
value eventually being deprecated and finally removed.

PR-URL: #2559
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
Reviewed-By: Roman Reiss <me@silverwind.io>

Copy link
Copy Markdown
Contributor

Thanks! Landed with some slight modifications to the commit message in 775c01e.

silverwind closed this Oct 9, 2015
jasonkarns deleted the document-emitter-setmaxlisteners-infinity branch October 9, 2015 17:45
jasnell pushed a commit that referenced this pull request Oct 10, 2015
Instead of recommending `0` as the magic value to set max listeners to
unlimited, recommend `Infinity`. This paves the way for `0` as a magic
value eventually being deprecated and finally removed.

PR-URL: #2559
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
Reviewed-By: Roman Reiss <me@silverwind.io>

jasnell commented Oct 10, 2015

Copy link
Copy Markdown
Member

Landed in v4.x with 0cfc6d3

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants


Back | FazBrowse Home | New Git URL