question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

There doesn't appear to be a way to track room creation/deletion

See original GitHub issue

You 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:closed
  • Created 7 years ago
  • Reactions:4
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
darrachequesnecommented, Mar 14, 2017

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

for (var i = 0; i < rooms.length; i++) {
    var room = rooms[i];
    this.sids[id] = this.sids[id] || {};
    this.sids[id][room] = true;
    if (!this.rooms.hasOwnProperty(room)) {
      this.rooms[room] = Room();
      this.emit('create-room', room);
    }
    this.rooms[room].add(id);
}
// and then
io.of('/').adapter.on('create-room', /* */);

What do you think?

0reactions
darrachequesnecommented, May 6, 2022

@Tsourdox no, this is not currently possible, but we could add this I guess 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Breakout rooms troubleshooting guide
Learn how to troubleshoot Microsoft Teams breakout rooms. ... The thread where the channel meeting was organized was deleted. The meeting was organized...
Read more >
How to Tell If Someone Deleted Life360
Life360 is designed to be the ultimate tracking app, as it's hard to trick and difficult to spoof your location.
Read more >
Best Practices for Office 365 Calendar Users
If you receive a meeting cancelation, click Remove from Calendar to remove the meeting from your calendar - Deleting the cancelation from your ......
Read more >
Prevent Outlook from automatically deleting meeting emails
In Outlook 2013 and 2016 (Office 365), this is under Options -> Mail -> under "Send messages": Delete meeting requests and notifications from...
Read more >
Complete Guide for Imprint™ Smart Maps and FAQs
How To: Creating a Map; Creating a Second Map; Editing or Deleting a Map. Adding New Areas/Rooms To My Map. If an Imprint™...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found