PUBSUB 频道

Syntax
PUBSUB CHANNELS [pattern]
Available since:
2.8.0
Time complexity:
O(N) where N is the number of active channels, and assuming constant time pattern matching (relatively short channels and patterns)
ACL categories:
@pubsub, @slow,

列出当前活动的频道

活动频道是具有一个或多个订阅者(不包括订阅模式的客户端)的 Pub/Sub 频道。

如果没有指定pattern,则列出所有通道,否则如果指定了pattern,则仅列出与指定glob样式模式匹配的通道。

集群说明:在Redis集群中,客户端可以订阅每个节点,也可以向其他每个节点发布消息。集群将确保根据需要转发发布的消息。也就是说,PUBSUB在集群中的回复仅报告来自节点的Pub/Sub上下文的信息,而不是整个集群的信息。

RESP2/RESP3 回复

Array reply: a list of active channels, optionally matching the specified pattern.
RATE THIS PAGE
Back to top ↑