FluidFramework
FluidFramework copied to clipboard
Server: expose socket.io internals for use in Nexus
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:
- Add a bunch of abstract functions to IWebSocket
- 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:
- Track Ping/Pong latency using packets
- 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
- 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.