PUBSUB SHARDNUMSUB
Since 1.1.0Pub/Sub
Syntax
PUBSUB SHARDNUMSUB [shardchannel ...]Returns, for each shard channel named, how many clients are subscribed to it with SSUBSCRIBE. A shard channel no one is subscribed to gets 0, and so does an ordinary channel's name: subscriptions made with SUBSCRIBE are counted by PUBSUB NUMSUB instead.
The channels come back in the order given; without any, the reply is an empty array. In a cluster, each node counts only its own clients, so ask the node that owns the channel's slot, and its replicas. See Pub/Sub in a cluster.
Reply
- A flat array of shard channel, count pairs.
Examples
client 2> SSUBSCRIBE orders
...
client 3> SUBSCRIBE news
...
client 1> PUBSUB SHARDNUMSUB orders news
1) "orders"
2) (integer) 1
3) "news"
4) (integer) 0