Skip to content

Conversation

@KhafraDev
Copy link
Member

This adds an events.getMaxListeners method that both EventEmitter & EventTarget can use. Currently, there isn't a way to get the max listeners for an EventTarget.

Undici currently increases AbortSignal's max listeners because 10 is too conservative for fetch. However someone might increase this limit, which we override. Using this we can detect if the limit's been changed, and not set our own default if it has.

import { getMaxListeners, setMaxListeners } from 'node:events'

const { signal } = new AbortController()

getMaxListeners(signal) // 10
setMaxListeners(11, signal)
getMaxListeners(signal) // 11

Refs: nodejs/undici#1910 (comment)

@nodejs-github-bot nodejs-github-bot added events Issues and PRs related to the events subsystem / EventEmitter. needs-ci PRs that need a full CI run. labels Mar 11, 2023
@debadree25
Copy link
Member

also cc'ing @nodejs/events

@debadree25 debadree25 added review wanted PRs that need reviews. request-ci Add this label to start a Jenkins CI on a PR. labels Mar 12, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Mar 12, 2023
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@debadree25 debadree25 added the semver-minor PRs that contain new features and should be released in the next minor version. label Mar 13, 2023
@debadree25
Copy link
Member

I think this would qualify as semver-minor too? since adding a new api hence added the label

@nodejs-github-bot

This comment was marked as outdated.

@debadree25 debadree25 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. and removed review wanted PRs that need reviews. labels Mar 16, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Mar 16, 2023
@nodejs-github-bot

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. events Issues and PRs related to the events subsystem / EventEmitter. needs-ci PRs that need a full CI run. semver-minor PRs that contain new features and should be released in the next minor version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants