我正在使用 laravel 5.1,我想知道有多少客户正在收听某个特定 channel ,比如 Test-Channel。我想要服务器上的这个号码?有什么办法可以得到它吗?此外,我正在使用 Redis 广播。
广播文档链接如下:
最佳答案
redis 中有这方面的命令。查看PUBSUB NUMSUB:
Returns the number of subscribers (not counting clients subscribed to patterns) for the specified channels.
和 PUBSUB NUMPAT:
Returns the number of subscriptions to patterns (that are performed using the PSUBSCRIBE command). Note that this is not just the count of clients subscribed to patterns but the total number of patterns all the clients are subscribed to.
编辑:还值得注意的是 PUBLISH命令还返回接收者的数量:
Return value
Integer reply: the number of clients that received the message.
关于redis - 如何确定收听广播的客户端数量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30821715/