I'm trying to implement a new feature that requires a bit of real time functionality. My project is built using Rails 5.1 and I want to achieve my goals using ActionCable.
Basically I have a dashboard with multiple widgets. Each widget displaying a certain informations like RAM & CPU usage, Git Hub Pull Requests Count, Issues Count, Honey Badger errors count, etc..
There is a Sidekiq job that runs every 30 seconds and saves the data in the DB. Right in the web page ( dashboards#show ) where the dashboard displays the widgets, I have a JS interval that pull data from the server every X (usually is set to 30s / 45s) seconds.
I want from the job to stream the values to a dashboard channel ( each dashboard will have its own channel ) using ActionCable.
My question is: how do I stream only to dashboards that are "online", how do I know if the page www.myapp.com/dashboards/1 is used?
Lets say I have 1000 dashboards, I don't want to stream data to all of the from the job, only to the dashboards that are "used".
Thank you!