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

Server: expose socket.io internals for use in Nexus #21090

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

znewton
Copy link
Contributor

@znewton znewton commented May 15, 2024

Description

There are a few usecases coming up that would require access to specific socket.io functionality. There are 2 ways to go about this, I think:

  1. Add a bunch of abstract functions to IWebSocket
  2. Add some specific Socket.io functionality to Nexus in its own helper classes

In the interest of not making IWebsocket too complicated, for now I've gone with option 2. The functionality currently added:

  1. Track Ping/Pong latency using packets
  2. Tracking per-socket data such as clientId, documentId, and tenantId in the Socket.io socket.data which will be available to other sockets in the Redis Pub/Sub cluster
  3. Retrieving all sockets in a given room, including other socket servers connected to the same Redis Pub/Sub instance
    • This one doesn't work with the Custom redis adapter yet, only the official one. Work incoming for this.

@github-actions github-actions bot added area: server Server related issues (routerlicious) base: main PRs targeted against main branch labels May 15, 2024
@znewton znewton requested a review from alteut May 15, 2024 22:30
@znewton znewton marked this pull request as ready for review May 15, 2024 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: server Server related issues (routerlicious) base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant