Redis

Redis的发布订阅

2020-06-13  本文已影响0人  码农GG

描述

进程间的一种消息通信模式:发送者(pub)发送消息,订阅者(sub)接收消息。

image.png

命令

image.png

案例

1 可以一次性订阅多个,SUBSCRIBE c1 c2 c3

image.png

2 消息发布,PUBLISH c2 hello-redis

image.png

3 订阅多个

通配符*  PSUBSCRIBE new*  

**4 收取消息

 PUBLISH new1 redis2015**
image.png
上一篇 下一篇

猜你喜欢

热点阅读