FluidFramework icon indicating copy to clipboard operation
FluidFramework copied to clipboard

Server: expose socket.io internals for use in Nexus

Open znewton opened this issue 9 months ago • 0 comments

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.

znewton avatar May 15 '24 16:05 znewton