发布和订阅
发布
publish channel message
例如:
publish news “todays news”
127.0.0.1:6379> publish news "today is sunshine"
(integer) 0
127.0.0.1:6379> publish news "today is sunshine1"
(integer) 1
127.0.0.1:6379> publish yes "yes yes yes"
(integer) 0
127.0.0.1:6379> publish news "today is sunshine1 yes"
(integer) 2
127.0.0.1:6379> publish news "today is sunshine1 yes 2"
(integer) 3
127.0.0.1:6379> publish yes "today is sunshine1 yes 2"
(integer) 1
127.0.0.1:6379> publish yes "today is sunshine1 yes 23"
(integer) 1
订阅
subscribe channel
例如:
subscribe news
127.0.0.1:6379> subscribe news