You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The heartbeat is going on all the time between the Django channels server and all connected clients. So having control over it as a programmer would have some really cool implications.
The first advantage of being able to override the heartbeat is having control over all connected clients without being bound by the clients in such a way that if the connected client doesn't send a message the server can't do anything about the connected client. Maybe I want to disconnect a client if they don't send a message in the next 60 seconds! Or maybe I want to send the first message from the server, but not immediately after connecting (I wouldn't schedule a thread for this, come on).
The second advantage I see, is keeping track of all connected clients in one loop (the heartbeat loop that's going on all the time).
The 3rd advantage may be a bit specific some projects like mine. I am working on both the clients and the server and I can customize the client's heartbeat but not the server's. If I had full control over the server's heartbeat, I could, for example, specify different heartbeats to different clients. Or I could literally generate a new heartbeat assembly bytes and send it to the client where the client could patch itself and use the new heartbeat!
I'm literally just a student and I have no idea what I'm talking about.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm pretty sure this is not possible as of now.
The heartbeat is going on all the time between the Django channels server and all connected clients. So having control over it as a programmer would have some really cool implications.
The first advantage of being able to override the heartbeat is having control over all connected clients without being bound by the clients in such a way that if the connected client doesn't send a message the server can't do anything about the connected client. Maybe I want to disconnect a client if they don't send a message in the next 60 seconds! Or maybe I want to send the first message from the server, but not immediately after connecting (I wouldn't schedule a thread for this, come on).
The second advantage I see, is keeping track of all connected clients in one loop (the heartbeat loop that's going on all the time).
The 3rd advantage may be a bit specific some projects like mine. I am working on both the clients and the server and I can customize the client's heartbeat but not the server's. If I had full control over the server's heartbeat, I could, for example, specify different heartbeats to different clients. Or I could literally generate a new heartbeat assembly bytes and send it to the client where the client could patch itself and use the new heartbeat!
I'm literally just a student and I have no idea what I'm talking about.
Thank you for reading
Cheers
Beta Was this translation helpful? Give feedback.
All reactions