There doesn't appear to be a way to track room creation/deletion
See original GitHub issueYou want to:
- report a bug
- request a feature
Current behaviour
Right now, it appears that rooms are a socket-level construct only. Individual connections appear to know what rooms they’re a part of. Adapters like socket.io-redis
appear to have just enough functionality to know how to route messages to all members of a room.
Expected behaviour
In many applications, socket.io
will sit on top of a room that represents some potentially costly resource. For instance, in my use case, I want to spin up a docker container to be used by everyone in a room. That means I need to know when to create one and when to delete one when it’s no longer being used.
I can try to track room membership on my own, but then I become a central point of failure anyhow.
Suggestion
In a system like the one socket.io-redis
suggests, I think it should be possible for all nodes to subscribe to when rooms are created or destroyed, since those changes should be pubbed through redis already.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:6 (3 by maintainers)
Top GitHub Comments
Well, I guess we could emit an event when a room is created:
https://github.com/socketio/socket.io-adapter/blob/1.1.0/index.js#L56
What do you think?
@Tsourdox no, this is not currently possible, but we could add this I guess 👍