Skip to content

fix(cli): #1575 resolve too many listeners with task queue#1656

Open
KaiPrince wants to merge 1 commit intoProjectEvergreen:masterfrom
KaiPrince:fix/issue-1575-resolve-max-event-listeners-warning
Open

fix(cli): #1575 resolve too many listeners with task queue#1656
KaiPrince wants to merge 1 commit intoProjectEvergreen:masterfrom
KaiPrince:fix/issue-1575-resolve-max-event-listeners-warning

Conversation

@KaiPrince
Copy link
Contributor

The max listeners warning from #1575 is caused by a listener added for each page waiting for a free worker. Node recommends a task queue, and I have copied that implementation here. Now the number of listeners remains constant and will not increase with the number of pages.

See https://nodejs.org/api/async_context.html#using-asyncresource-for-a-worker-thread-pool.

Related Issue

Resolves #1575

Documentation

No documentation changes.

Summary of Changes

  1. Push to task queue instead of adding a listener
  2. Added link to Node docs

@thescientist13 thescientist13 changed the title fix(cli): resolve too many listeners with task queue fix(cli): #1575 resolve too many listeners with task queue Mar 19, 2026
@thescientist13 thescientist13 added bug Something isn't working CLI labels Mar 19, 2026
Copy link
Member

@thescientist13 thescientist13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh dang, nice. That's pretty clean. ✨

Just gave this a test in ProjectEvergreen/www.greenwoodjs.dev#249 and no more warnings!

Thanks so much!

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

Labels

bug Something isn't working CLI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

resolve max event listeners warning

2 participants