PUBSUB NUMSUB

PUBSUB NUMSUB

PUBSUB NUMSUB [channel]
Available since
2.8.0
Time complexity
O(N) for the NUMSUB subcommand, where N is the number of requested channels
ACL categories
@pubsub, @slow

Returns the number of subscribers (exclusive of clients subscribed to patterns) for the specified channels.

Note that it is valid to call this command without channels. In this case it will just return an empty list.

Cluster note: in a Redict Cluster clients can subscribe to every node, and can also publish to every other node. The cluster will make sure that published messages are forwarded as needed. That said, PUBSUB’s replies in a cluster only report information from the node’s Pub/Sub context, rather than the entire cluster.

Redict logo courtesy of @janWilejan, CC-BY-SA-4.0. Download SVG ⤑

Portions of this website courtesy of Salvatore Sanfilippo, CC-BY-SA-4.0.