博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
redis发布/订阅广播_Redis发布/订阅
阅读量:2505 次
发布时间:2019-05-11

本文共 748 字,大约阅读时间需要 2 分钟。

redis发布/订阅广播

Redis implements a publish/subscribe messaging mechanism.

Redis实现了发布/订阅消息传递机制。

Its concept is simple: a publisher sends a message on a channel. Multiple subscribers receive it.

它的概念很简单:发布者在频道上发送消息。 多个订户收到它。

Subscribe to a channel using

订阅频道使用

SUBSCRIBE 

Publish to a channel using

使用发布到频道

PUBLISH 

Example:

例:

SUBSCRIBE dogs

In another redis-cli window, type:

在另一个redis-cli窗口中,输入:

PUBLISH dogs "Roger"

Messages will be sent to the subscribers, and they’ll by default display the kind of event, the channel, and the message:

消息将发送给订阅者,默认情况下,它们将显示事件的种类,频道和消息:

Subscribers can listen on multiple channels:

订户可以在多个频道上收听:

SUBSCRIBE dogs cats

and will receive messages coming from all of them.

并会收到来自所有人的消息。

翻译自:

redis发布/订阅广播

转载地址:http://pxmgb.baihongyu.com/

你可能感兴趣的文章
回测引擎代码分析流程图
查看>>
Excel 如何制作时间轴
查看>>
matplotlib绘图跳过时间段的处理方案
查看>>
vnpy学习_04回测评价指标的缺陷
查看>>
设计模式10_桥接
查看>>
量化策略回测DCCV2
查看>>
mongodb查询优化
查看>>
五步git操作搞定Github中fork的项目与原作者同步
查看>>
git 删除远程分支
查看>>
删远端分支报错remote refs do not exist或git: refusing to delete the current branch解决方法
查看>>
python multiprocessing遇到Can’t pickle instancemethod问题
查看>>
APP真机测试及发布
查看>>
通知机制 (Notifications)
查看>>
10 Things You Need To Know About Cocoa Auto Layout
查看>>
一个异步网络请求的坑:关于NSURLConnection和NSRunLoopCommonModes
查看>>
iOS 如何放大按钮点击热区
查看>>
ios设备唯一标识获取策略
查看>>
获取推送通知的DeviceToken
查看>>
Could not find a storyboard named 'Main' in bundle NSBundle
查看>>
CocoaPods安装和使用教程
查看>>