socket.io icon indicating copy to clipboard operation
socket.io copied to clipboard

Events when rooms are created and deleted automatically.

Open mhretab opened this issue 12 years ago • 4 comments

Hi,

I am working on a project where rooms are created and deleted dynamically and I don't have any way of knowing when a room is created or deleted. it would be nice to have this feature. Now I am counting the number of users on that room when joining and if it is only one then the room is being created..., but that is not efficient and would be nice to have an event like on room creation or deletion.

Thank you in advance!

mhretab avatar Jul 01 '14 12:07 mhretab

Until someone decides to do this or not, a suggestion you might benefit from possible using something like redis to keep track of the rooms. I know it isn't directly sockets handling it, but redis works really well for dynamic rooms with socket.io, keeping track of users in each room, and whether they are still open or not.

TheBubbleDuck avatar Jul 24 '14 20:07 TheBubbleDuck

I believe the best way is to implement that feature independently from socket.io itself. I'm not even sure if the most recent version deletes empty rooms at all (at least without redis adapter). You may want to take a look at the socket.io-hotel package (https://github.com/gpestana/socket.io-hotel) , which is a seamless room manager for socket.io. That feature is not implemented but suggest it or patch it.

gpestana avatar Jul 25 '14 09:07 gpestana

@gpestana rooms are deleted automatically when empty.

@rauchg thoughts on adding the event?

rase- avatar Jan 13 '15 17:01 rase-

That issue was closed automatically. Please check if your issue is fixed with the latest release, and reopen if needed (with a fiddle reproducing the issue if possible).

darrachequesne avatar Jan 12 '17 15:01 darrachequesne