Join GitHub today
Subscribe individual tabs to channels #223
I would really like to be able to subscribe only individual tabs to channels.
A cursory survey of the source (which, oh my god, looks really, really nice and clean! that's the way source-code should be!) leaves me with the impression that I could rather easily patch on this behavior (after all, channels seem to speak directly to socketIds anyway), it would take a bit of additional work to get subscribe/unsubscribe behavior at session level to play nicely though.
What one could do is attach an extra (optional) attribute to the session, maybe 'partialChannels' which are affected by session-wide unsubscribes. Unsubscribing individual tabs might be a bit more messy, as the expected behavior would probably be that a session-wide subscription is then demoted to a partial subscription.
What do you think? Should I patch this on from the outside or would you be interested in integrating this into socketstream?
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
I agree there is a need for this. The main problem is that socketIds are very transitory.
Should the connection go down and reconnect for any reason (server reboot, wifi problems, user hits reload by accident), you get another socketId - so the app would have to deal with this and manually resubscribe.
Ideally I think we should offer both
At the heart of this is a much bigger and broader discussion: Should individual tabs simply act as multiple interfaces to the same app, or function completely independently? Ultimately I think we should leave the decision to the app developer and provide the best tools for both approaches.