PUBSUB SHARDNUMSUB

Syntax
PUBSUB SHARDNUMSUB [shardchannel [shardchannel ...]]
Available since:
7.0.0
Time complexity:
O(N) for the SHARDNUMSUB subcommand, where N is the number of requested shard channels
ACL categories:
@pubsub, @slow,

返回指定分片频道的订阅者数量。

请注意,在没有通道的情况下调用此命令是有效的,在这种情况下,它将只返回一个空列表。

集群说明:在Redis集群中,PUBSUB的回复仅报告来自节点的Pub/Sub上下文的信息,而不是整个集群的信息。

示例

> PUBSUB SHARDNUMSUB orders
1) "orders"
2) (integer) 1

RESP2/RESP3 回复

Array reply: the number of subscribers per shard channel, each even element (including the 0th) is channel name, each odd element is the number of subscribers.
RATE THIS PAGE
Back to top ↑