案列

  1. 127.0.0.1:6379> SUBSCRIBE news.IT news.CCTV
  2. Reading messages... (press Ctrl-C to quit)
  3. 1) "subscribe"
  4. 2) "news.IT"
  5. 3) (integer) 1
  6. 1) "subscribe"
  7. 2) "news.CCTV"
  8. 3) (integer) 2
  9. 1) "message"
  10. 2) "news.IT"
  11. 3) "redis"
  12. 1) "message"
  13. 2) "news.CCTV"
  14. 3) "xidada"
  15. 1) "message"
  16. 2) "news.IT"
  17. 3) "Nginx"
  18. ^C
  1. 127.0.0.1:6379> PUBLISH news.IT redis
  2. (integer) 1
  3. 127.0.0.1:6379> PUBLISH news.CAR audi
  4. (integer) 0
  5. 127.0.0.1:6379> PUBLISH news.CCTV xidada
  6. (integer) 1