Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

make ee._maxListeners public #8237

Closed
jonathanong opened this issue Aug 22, 2014 · 7 comments
Closed

make ee._maxListeners public #8237

jonathanong opened this issue Aug 22, 2014 · 7 comments

Comments

@jonathanong
Copy link

any reason it's private? i'd like to increment/decrement the value as i add/remove listeners to avoid the stupid warning while not being irresponsible. specifically:

ee.maxListeners++

ee.once('event', function () {
  // do stuff
  ee.maxListeners--
})
@indutny
Copy link
Member

indutny commented Aug 27, 2014

Can't you just do it with a setMaxListeners?

@dougwilson
Copy link
Member

Can't you just do it with a setMaxListeners?

The idea is to ++ and --; setMaxListeners would work, if there was a way to get the current max listeners in a public API.

@indutny
Copy link
Member

indutny commented Sep 2, 2014

Ok, sou you really need getMaxListeners, this sounds reasonable! Would you please mind opening a PR for this?

@vkurchatkin
Copy link

@indutny maybe just rename _maxListeners -> maxListeners? getMaxListeners looks too java-ish (=ugly)

@trevnorris
Copy link

@vkurchatkin I wouldn't say it's java-ish. Now retrieveTheValueForMaxListeners() would be java-ish. ;-P

Anyway, I prefer this because internal implementation can change in the future and changes in the implementation details can be masked behind the function call.

@cjihrig
Copy link

cjihrig commented Jan 20, 2015

Oops. GitHub went ahead and closed that on its own.

@jasnell
Copy link
Member

jasnell commented Jun 22, 2015

Landed in io.js. Will pick it up in the converged stream. see https://iojs.org/api/events.html#events_emitter_getmaxlisteners

@jasnell jasnell closed this as completed Jun 22, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants