django-websocket-redis icon indicating copy to clipboard operation
django-websocket-redis copied to clipboard

Connection status callback

Open smcdonald-bepress opened this issue 11 years ago • 1 comments

This patch adds an optional "status_callback" parameter to the connection options. This callback is called with a single boolean parameter indicating the connection status only when the state changes (i.e. it does not repeatedly fire with "false" when a connection attempt fails).

If your code relies on the websocket connection for major functionality, this provides a means to give feedback to the user and/or client code if the connection is lost. I'm open to other ideas to achieve this goal, but this seemed like the simplest and most flexible way to get there.

smcdonald-bepress avatar Oct 23 '14 21:10 smcdonald-bepress

status_callback then would have to become an additional configuration parameter. This should be documented.

jrief avatar Dec 21 '15 16:12 jrief