How would you incorporate a long-running thread that pushes events to the client?
I assume the thread would call socket.send_and_broadcast_channel(message), but what would be the best way to launch that thread so it would be ran by runserver_socketio?
I'm trying to create a simple monitoring application that reads server metrics and pushes these metrics to the client when they change. The chat example is great, but it's events are still triggered by the client, so it's unclear how a pure server-push example would work.
How would you incorporate a long-running thread that pushes events to the client?
I assume the thread would call
socket.send_and_broadcast_channel(message)
, but what would be the best way to launch that thread so it would be ran by runserver_socketio?I'm trying to create a simple monitoring application that reads server metrics and pushes these metrics to the client when they change. The chat example is great, but it's events are still triggered by the client, so it's unclear how a pure server-push example would work.