当前位置:网站首页>Redis publish and subscribe
Redis publish and subscribe
2022-07-04 14:54:00 【BugMaker-shen】
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
Redis Publish and subscribe to
(1) The client can subscribe to channels, as shown in the figure below

(2) When you post a message to this channel , The message is sent to the subscribing client 
Publish subscribe command line practice
(1) Open a client subscription channel1
SUBSCRIBE channel1

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

notes : 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
边栏推荐
- Nowcoder reverse linked list
- es6模块化
- Exploration and practice of eventbridge in the field of SaaS enterprise integration
- SAIC Maxus officially released its new brand "mifa", and its flagship product mifa 9 was officially unveiled!
- Gin integrated Alipay payment
- 深度学习7 Transformer系列实例分割Mask2Former
- Respect others' behavior
- LeetCode 1200 最小绝对差[排序] HERODING的LeetCode之路
- [cloud native] how can I compete with this database?
- UFO: Microsoft scholars have proposed a unified transformer for visual language representation learning to achieve SOTA performance on multiple multimodal tasks
猜你喜欢

Halo effect - who says that those with light on their heads are heroes

LVGL 8.2 Line

LVGL 8.2 LED

LVGL 8.2 text shadow

No servers available for service: xxxx

Opencv learning notes - linear filtering: box filtering, mean filtering, Gaussian filtering

Classify boost libraries by function

智能客服赛道:网易七鱼、微洱科技打法迥异
![[information retrieval] experiment of classification and clustering](/img/05/ee3b3bc4ab79d52b63cdc34305aa57.png)
[information retrieval] experiment of classification and clustering
![leetcode:6109. Number of people who know the secret [definition of DP]](/img/95/03e2606b249f26db052cf5075041c1.png)
leetcode:6109. Number of people who know the secret [definition of DP]
随机推荐
深度学习7 Transformer系列实例分割Mask2Former
Transplant tinyplay for imx6q development board QT system
Pandora IOT development board learning (RT thread) - Experiment 3 button experiment (learning notes)
A collection of classic papers on convolutional neural networks (deep learning classification)
程序员自曝接私活:10个月时间接了30多个单子,纯收入40万
Free, easy-to-use, powerful lightweight note taking software evaluation: drafts, apple memo, flomo, keep, flowus, agenda, sidenote, workflow
03-存储系统
Ffprobe common commands
Is BigDecimal safe to calculate the amount? Look at these five pits~~
现代控制理论入门+理解
Count the running time of PHP program and set the maximum running time of PHP
LVGL 8.2 Line
Leetcode t49: grouping of alphabetic words
Partial modification - progressive development
内存管理总结
Leetcode 1200 minimum absolute difference [sort] The Path of leetcode for heroding
Detailed analysis of pytorch's automatic derivation mechanism, pytorch's core magic
Exploration and practice of eventbridge in the field of SaaS enterprise integration
Ranking list of databases in July: mongodb and Oracle scores fell the most
Cann operator: using iterators to efficiently realize tensor data cutting and blocking processing