8000 expose Presence setMaxListeners by sylvainpolletvillard · Pull Request #849 · colyseus/colyseus · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

expose Presence setMaxListeners #849

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 7, 2025

Conversation

sylvainpolletvillard
Copy link
Contributor

Node EventEmitter used in Presence has a built-in maxListeners used to try to detect and prevent memory leaks. Its default value is 10 listeners, which is short when you have more than 10 rooms that need:

(node:85265) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 server-announcement listeners added to [EventEmitter]. MaxListeners is 10. Use emitter.setMaxListeners() to increase limit

Problem is the emitter is not exposed by Presence, so there's no way to call this setMaxListeners method from colyseus.

This PR exposes this setMaxListeners method so that we can set the presence maxListeners without changing the default value for all EventEmitters.

@endel endel merged commit 005ba4f into colyseus:master Apr 7, 2025
1 check failed
endel added a commit that referenced this pull request Apr 7, 2025
@endel
Copy link
Member
endel commented Apr 7, 2025

Thank you so much @sylvainpolletvillard, just bumped versions of @colyseus/core and @colyseus/redis-presence with your addition 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0