Skip to content

Replace node's EventEmitter interface #3294

@hueniverse

Description

@hueniverse

The current public interfaces using node's EventEmitter are being switched over to a new implementation that supports many new features including async handlers, counters (not just once), and argument cloning. Over the years we had multiple requests for such features but were limited by node's EventEmitter implementation.

As part of this transition, the following emitter APIs will no longer be supported:

  • newListener and removeListener events
  • listenerCount()
  • defaultMaxListeners
  • eventNames()
  • getMaxListeners()
  • listenerCount()
  • listeners()
  • prependListener()
  • prependOnceListener()
  • setMaxListeners()

In addition, all existing server, request, and response events that are part of the hapi API (e.g. request.raw emitters remain unchanged) will switch to use a single format handler with a fixed number of arguments (vs. the current per-event-type function signature).

Metadata

Metadata

Assignees

Labels

breaking changesChange that can breaking existing codefeatureNew functionality or improvement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions