we have django 2.0.4 and channels 2.1.7 in production.
And now users must have only open 1 session allowed. (when a user logs in 
the second time, the first open websocket connection must be closed). I'm 
out of ideas on how to do it.

AFAIK, `websocket.disconnect` must be sent from the client, and it is not 
what I want (what's the point to tell the client "hey, tell me that you 
want to disconnect, because I say so..." if I can close it myself?). I've 
read this 
<https://channels.readthedocs.io/en/latest/topics/consumers.html#closing-consumers>
 
chapter and the related issue in Github and also would like to see a code 
snippet how to do this.

I also read about a similar issue (54518717 at SO) which is about a "kick 
out" user from a specific group. but what if I need to kick him out of all 
his possible groups/channels?

i noticed, that after a user logs in ha connects to a bunch of groups:

1) "asgi::group:room__36"         <--- group for his UserGroup(36)
2) "asgi::group:238"              <--- his personal group, for User(238)
3) "asgi::group:notifications.36" <--- another group for his UserGroup(36)

so, one group can be discarded as a whole, and from others... he must be 
ZREM'ed somehow?

So, any help or direction would be very appreciated.
Thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ab8fa346-5aab-4894-8eb0-0c4b24667ca0%40googlegroups.com.

Reply via email to