-
-
Notifications
You must be signed in to change notification settings - Fork 37.3k
Expose setMaxListeners property on AbortSignal #54758
Copy link
Copy link
Closed
Labels
feature requestIssues requesting new Node.js features.Issues requesting new Node.js features.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.web-standardsIssues and PRs related to web-platform APIs and standards compliance.Issues and PRs related to web-platform APIs and standards compliance.
Description
Activity
Metadata
Metadata
Assignees
Labels
feature requestIssues requesting new Node.js features.Issues requesting new Node.js features.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.web-standardsIssues and PRs related to web-platform APIs and standards compliance.Issues and PRs related to web-platform APIs and standards compliance.
Type
Projects
- StatusShow more project fieldsAwaiting Triage
What is the problem this feature will solve?
Right now, there is no stable way to change the
maxEventTargetListenersof anAbortSignalwithout importing fromnode:events.This makes it impossible to write isomorphic library code that adds more than the default 10 event listeners, without having to resort to workarounds such as
This relies on the
events.maxEventTargetListenerssymbol description, which, to my knowledge is not part of any public API and could change at any time.What is the feature you are proposing to solve the problem?
Add a
AbortSignal.setMaxListenersinstance method so isomorphic code could do something likeWhat alternatives have you considered?
Alternatively, if this is not an option as it could pollute a spec-defined object with additional properties, use
Symbol.forinstead ofnew SymbolforkMaxEventTargetListenersand make that a part of the official api.I would be willing to implement this feature.