-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build Admin feature that requests heartbeat from all connected clients. #22
Comments
Today's Progress
Here, I just clicked on the "Request heartbeat..." link and Connections No 3 & 4 updated their "Last Heartbeat" timestamps. Conn No 1 & 2 didn't update though because those clients have been closed (either due to connectivity loss of the Chrome tab was force-closed, etc). Next Steps
|
…he Admin GUI. Add 'Broadcast Flash Message' fxn on the Admin GUI. Add 'Request heartbeat from all clients' fxn on the Admin GUI.
…n if 'clientMap.size>0'. The loops detect and evict stale connections. Their values are driven by .env config.
Next
Not a bug: clientMap on the Admin GUI is 10 seconds behind the ts that's being broadcast to all client endpoints. Investigate and fix. clientMap should only be broadcasted to all endpoints in the following cases:
|
… time a client is added or removed, or if the refreshLoop runs. The 'clientMap' is no longer broadcast on every client heartbeat.
…/js/config.js'. Update this to be driven from server-side config later.
Problem
SSE doesn't automatically detect if a client has died. This means over time our
clientMap
will be polluted with zombie clients. Cycling the server will request an auto-reconnect (supported by SSE out of the box) but we need another way to prune dead clients fromclientMap
.Solution
Add a REST endpoint that, when hit, requests a heartbeat from all connected clients that are still alive. Any client that doesn't pong back within X seconds will then be removed from
clientMap
. [Should this REST endpoint be a GET or POST?]Tasks:
clientMap
into a beautiful table.Prune zombie clients!
button & function to the admin GUI.The text was updated successfully, but these errors were encountered: