Sending Messages from Web Server to Web Client using Websockets, Redis and Webdis

Sometimes your web application will initiate some server-side code that runs for an extended period. This can be a problem for a user left staring at a web page with no feedback – the temptation is to re-submit, go back or even close the application. I found this to be particularly relevant while working on network automation applications that involve a lot of relatively slow interactions with network devices.
What is needed is a way to continuously update the user with messages so that they can see that the application is functioning correctly.
This post will describe how to use WebSockets, Redis, and Webdis to send messages from the server-side of your web application to the client.

The web client “subscribes” to the message queue and the server “publishes” to the queue. Every message published by the server is seen by the client. The client does not have to request the message.
Continue reading Sending Messages from Web Server to Web Client using Websockets, Redis and Webdis