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

向给定频道(Channel)发送一条消息。

Posts a message to the given channel.
  • 接收到当前消息的客户端(Client)的数量。

    Integer reply: the number of clients that received the message.
  • 版本支持

    2.0.0+

    时间复杂度(Time complexity)

    O(N+M)

    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).