回到顶部

Contents

Django Channels 2: How Many Users Is In The Specific Room

django channels 获取房间的用户数

 

from:

https://stackoverflow.com/questions/62416673/django-channels-2-how-many-users-is-in-the-specific-room

 

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())

^_^
请喝咖啡 ×

前一篇: aioredis.errors.ReplyError: ERR unknown command 'BZPOPMIN'
下一篇: Django Channels websocket 搭建实践(实现长链接消息通知功能)
captcha