eventemitter.setMaxListeners()

emitter.setMaxListeners(n)

By default EventEmitters will print a warning if more than 10 listeners are added for a particular event. This is a useful default that helps finding memory leaks. Obviously, not all events should be limited to just 10 listeners. The emitter.setMaxListeners() method allows the limit to be modified for this specific EventEmitter instance. The value can be set to Infinity (or 0) for to indicate an unlimited number of listeners.

Returns a reference to the EventEmitter so calls can be chained.

doc_Nodejs
2016-04-30 04:39:29
Comments
Leave a Comment

Please login to continue.