jrief / django-websocket-redis

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

Added the _websockets attribute to store active connections #192

Closed Keilan closed 8 years ago

Keilan commented 8 years ago

My first attempt in regards to Issue 191.

jrief commented 8 years ago

I'll have a look as soon as I have some time. I would create a dict with many entries for each channel. Then when a connection opens, increate the value of that channel. If a connection breaks, decrease it.

pirate commented 8 years ago

+1 I would find this useful and I think it's fairly safe. It would be nice to map websockets to the user who owns that connection somehow, so that views can look up currently active websockets for a user, but that logic definitely should not be in wsgi_server.py.