Hey guys -
I need an admin to visit a page like user/234 and connect to a phoenix channel to get the user’s latest changes.
We’re getting that change data over a websocket connection to couchbase.
So 99.9% of the time, no one will be on page /user/234. So it seems silly that each time I get a message from couchbase, I join that channel user:234, broadcast the info I got from the couchbase websocket, and leave the channel, right? Because no one else is in the channel to receive it most of the time? Or am I worried about nothing because joining and broadcasting is so lightweight?
The other way I thought to implement is when a user joins a channel, on join I initiate a connection to couchbase’s websocket. But then if I have 3 ppl join the same channel, I have 3 connections to couchbase’s websocket all broadcasting messages to the channel… so, seems bad.