Skip to content
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

feat(sharded): add an option for dynamic private channels #526

Merged
merged 1 commit into from
Mar 13, 2024

Conversation

MartinKolarik
Copy link
Contributor

As an alternative solution for #524, this:

  • adds a new option dynamicPrivateChannels, which allows creating separate channels even for private rooms; defaults to false so there's no change in default behavior,
  • includes the fix from fix(sharded): private room broadcast in dynamic mode #525 which is needed when the option is set to false

@darrachequesne
Copy link
Member

Actually, I'm not sure that this is a good idea, as it could indicate that calling io.to(specificSocketId).emit() is recommended.

@MartinKolarik thoughts?

@MartinKolarik
Copy link
Contributor Author

@darrachequesne I think it makes sense if it's documented in regards to socketInstance.emit() as that method is public and not discouraged, as I understand (unlike using the ID directly). Maybe with a note that it's useful in some scenarios where you have lots of 1:1 communication and understand what you're doing. In our specific case, this simple change resulted in 70% - 80% overall redis load reduction.

@darrachequesne darrachequesne merged commit 50220f4 into socketio:main Mar 13, 2024
2 checks passed
@darrachequesne
Copy link
Member

Thanks 👍

@MartinKolarik MartinKolarik deleted the dynamic-private-2 branch March 13, 2024 13:44
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