Is it possible to know how many clients subscribed a "channel" in redis?
I di开发者_运维技巧dnt find any commands to know how many client subscribed a channel (subscribe) in redis... Somebody know?
Thanks,
Publish
Return value
Integer reply: the number of clients that received the message.
That way when you publish to your channel, you be informed how many users are connected.
You could also keep track of this yourself using incr to increment counter when somebody subscribes to that channel and decr on unsubscribe to that channel. That way you can always know how many users are connected to that channel.
精彩评论