Reputation: 85
I am using django-channels>=2.0.0 and I want to find how many users in "room1". I don't know how to find total connections.
Upvotes: 4
Views: 1671
Reputation: 8077
Using the InMemoryChannelLayer
, inside your consumer
, you can check how many connections have been added to your channel layer with :
len(self.channel_layer.groups.get('room1', {}).items())
Upvotes: 0