jrief / django-websocket-redis

Websockets for Django applications using Redis as message queue
http://django-websocket-redis.awesto.com/
MIT License
895 stars 222 forks source link

Seeing active connections? #191

Open Keilan opened 8 years ago

Keilan commented 8 years ago

Is there a way to determine if there are any active websockets? I am generating live data on the server through a fairly expensive process and I'd like to only do it when someone is listening. Alternatively, a way to check if we are receiving any response heartbeat messages would fit my needs.

P.S. Thanks for the great work on this project - I'm just getting started with websockets and this is pretty slick.

jrief commented 8 years ago

This feature request has been proposed several times. Due to the lack of time, I was unable to implement it. You want to do it? It shouldn't be too difficult.

Keilan commented 8 years ago

I'll give it a shot - I'll need to get a bit more familiar with the project first. Thanks!

Keilan commented 8 years ago

@jrief I've made an attempt in Pull Request #192 to add this. I used a property on the WebsocketWSGIServer model, but it's not immediately clear to me how to access the property once it is set. Any pointers would be appreciated. :)

Fitblip commented 8 years ago

A dirty hack to get them as well is to just issue the redis pubsub channels depending on how you have your sessions structured.