Open xeor opened 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?
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.
Was something like this implemented?
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:
python
get a value. Some people might wantpython
,typescript
andredis
.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?