本文内容为 http://www.redis.io/commands/punsubscribe 的翻译、注解、例子扩充及其它修改。感谢 Redis 作者 Antirez 为开源社区作出的贡献,本文保证最新、最准、最全以表示对其的敬意。欢迎留言纠错、提示更新或支持。
PUNSUBSCRIBE [pattern [pattern ...]]

使客户端程序(Client)取消订阅(Unsubscribe)匹配给定模式的频道(Channel),如果未给定任何匹配模式,则取消订阅所有频道。

Unsubscribes the client from the given patterns, or from all of them if none is given.

如果未提供任何匹配模式,当前客户端(程序)将会取消订阅之前订阅的所有模式。在这种情况下,对每一个被取消订阅的模式,都会有一条消息发送给客户端。

Unsubscribes the client from the given patterns, or from all of them if none is given.

When no patterns are specified, the client is unsubscribed from all the previously subscribed patterns. In this case, a message for every unsubscribed pattern will be sent to the client.

  • 版本支持

    2.0.0+

    时间复杂度(Time complexity)

    O(N+M)

    O(N+M) where N is the number of patterns the client is already subscribed and M is the number of total patterns subscribed in the system (by any client).