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

Dynamic groups/channels subscription #189

Open xeor opened 8 years ago

xeor commented 8 years ago

I found https://github.com/jrief/django-websocket-redis/issues/162, which mostly fits this issue, but since it wasn't understood, I am trying again.

Currently, there are support for using the logged in users group, user itself, session, or broadcast when subscribing to what messages you want your users to get. Some times, you want more options, example:

Currently, the only way I can see to get these messages from the server to an arbitrary set of groups is to have 1 websocket connection with each group as it's own facility. (I might be wrong on that tho).

So, basically, something like ?subscribe-tags=python,typescript,redis, when subscribing. And on the server; programmers_publish = RedisPublisher(facility='public', groups=['python', 'typescript'])

Is there already a way to do this? Is it out of scope of this project? Is this something to think about? Will a pull-request implementing this be accepted?

jrief commented 8 years ago

So, if I understand this properly, you want to reuse the same websocket, both for say, group and session-based communication from the same client's page. This however means that we have to dispatch the communicated payload somehow. Is this your intention?

xeor commented 8 years ago

Yes, reusing the same connection for arbitrary groups that isn't necessary a group on the django user itself. topic might be a better word than tags. User 1 wants info about topic a,b, and user 2 wants topic a,c,d.

Jiloc commented 6 years ago

Was something like this implemented?