setMaxListeners method

AsyncEventEmitter setMaxListeners(
  1. int maxListeners
)

By default AsyncEventEmitters print a warning if more than 10 listeners are added for a particular event. This is a useful default that helps finding memory leaks. This method modifies the limit for this specific AsyncEventEmitter instance. The value can be set to Infinity (or 0) to indicate an unlimited number of listeners. @param maxListeners @returns A reference to the event emitter, so that calls can be chained.

Implementation

AsyncEventEmitter setMaxListeners(int maxListeners) {
  _maxListeners = maxListeners;
  return this;
}