User A makes a socket connection and “user:A” channel/topic is created. This channel will be used for all application specific data (will mimic classic HTTP req/res pattern) for this user. The same thing will happen when user B connects.
User A views user’s B profile, perhaps sends this user an email basically does something that user B might be interested in knowing.
These users are not subscribed to the same channel:topic. Therefore how can I propagate this specific event (for example “user A viewed your profile”) from user’s A socket over to user’s B socket?
One possible solution would be to have two channels (one public to which all users subscribe and one private) for all users but I don’t want to notify user C that user A visited user’s B profile. This event would have been propagated to all connected clients over the public channel, which is not really what I’d want (seems like a waste of resources to send a message to N users when only one is interested).
Is there a way to filter this somehow? Would I have to filter/ignore on the client side?
I’m on mobile so I’ll keep it short. But as I understand you, you can do a global channel that everyone joins and use handle_out to do the filtering before actually sending the message over the network.