Browse Source

doc: recommend Infinity on emitter.setMaxListeners

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: https://github.com/nodejs/node/pull/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>
v5.x
Jason Karns 10 years ago
committed by Roman Reiss
parent
commit
775c01e3aa
  1. 2
      doc/api/events.markdown

2
doc/api/events.markdown

@ -92,7 +92,7 @@ Returns emitter, so calls can be chained.
By default EventEmitters will print a warning if more than 10 listeners are By default EventEmitters will print a warning if more than 10 listeners are
added for a particular event. This is a useful default which helps finding added for a particular event. This is a useful default which helps finding
memory leaks. Obviously not all Emitters should be limited to 10. This function memory leaks. Obviously not all Emitters should be limited to 10. This function
allows that to be increased. Set to zero for unlimited. allows that to be increased. Set to `Infinity` (or `0`) for unlimited.
Returns emitter, so calls can be chained. Returns emitter, so calls can be chained.

Loading…
Cancel
Save