回到顶部

阅读目录

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 搭建实践(实现长链接消息通知功能)