当前位置:网站首页>Redis publishing and subscription
Redis publishing and subscription
2022-07-19 08:27:00 【Illusory clarity】
1. What is publish and subscribe
Redis Publish subscribe (pub/sub) It's a message communication mode : sender (pub) Send a message , subscriber (sub) receive messages . Redis Clients can subscribe to any number of channels .
2. Redis Publish and subscribe to
1、 The client can subscribe to channels, as shown in the figure below
A client can subscribe to multiple channels .
2、 When you post a message to this channel , The message is sent to the subscribing client 
3. Publish and subscribe command line implementation
1、 Open a client subscription channel1
SUBSCRIBE channel1

2、 Open another client , to channel1 Release the news hello
publish channel1 hello

Back to 1 Is the number of subscribers
3、 Open the first client to see the sent message 
notes :
Published messages are not persistent , If the subscription client does not receive hello, Only messages published after subscription can be received
边栏推荐
猜你喜欢

WPF 三维应用搭建(基础)

SCA在得物DevSecOps平台上应用

Junit5

Visual studio 2022 (vs 2022) cannot read memory

Deep learning 7 deep feedforward network 2

Redis常用数据类型——Redis列表(List)和Redis 集合(Set)

Database write Optimization: database and table segmentation and related issues

Bean、

Unity: WebGL发布后在浏览器上运行时窗口大小自适应

Talk about distributed locks
随机推荐
MySQL数据类型
警惕!又一起网络钓鱼攻击事件:Uniswap被盗810万美元
Can seaport and erc-4907 become new ways to release NFT liquidity| Tokenview
微服务与微服务架构
QT related problems encountered when writing code
Filesourcestrategy, datasourcestrategy and datasourcev2strategy in spark
openpyxl跨工作簿复制sheet页
Redis data persistence
visual studio 2022(VS 2022)无法读取内存的问题
超干货!彻底搞懂Golang内存管理和垃圾回收
SCA在得物DevSecOps平台上应用
Redis常用数据类型——Redis列表(List)和Redis 集合(Set)
WPF 三维应用搭建(基础)
Error received from peer ipv4/Connection reset by peer Paddleserving服务化部署后报错
Redis introduction
Unity: WebGL发布后在浏览器上运行时窗口大小自适应
Detailed explanation of type, user-defined type, preliminary understanding of structure
通过ip获取归属地
Use of OpenCV polar transformation function warppolar
Solution to sudo PIP install gevent installation failure