发布

Syntax
PUBLISH channel message
Available since:
2.0.0
Time complexity:
O(N+M) where N is the number of clients subscribed to the receiving channel and M is the total number of subscribed patterns (by any client).
ACL categories:
@pubsub, @fast,

向给定频道发布消息。

在Redis集群中,客户端可以向每个节点发布消息。集群确保发布的消息根据需要被转发,因此客户端可以通过连接到任何一个节点来订阅任何频道。

RESP2/RESP3 回复

Integer reply: the number of clients that the message was sent to. Note that in a Redis Cluster, only clients that are connected to the same node as the publishing client are included in the count.
RATE THIS PAGE
Back to top ↑