February 2018
Intermediate to advanced
382 pages
11h 33m
English
To show how to use PubSub, take a recommendation message-pushing system as an example.
Open three consoles to simulate two subscribers in console-A (SUBer-1) and console-B (SUBer-2), and also one publisher in console-C (PUBer):
127.0.0.1:6379> SUBSCRIBE restaurants:Chinese Reading messages... (press Ctrl-C to quit) 1) "subscribe" 2) "restaurants:Chinese" 3) (integer) 1
127.0.0.1:6379> SUBSCRIBE restaurants:Chinese restaurants:Thai Reading messages... (press Ctrl-C to quit) 1) "subscribe" 2) "restaurants:Chinese" 3) (integer) 1 1) "subscribe" 2) "restaurants:Thai" 3) (integer) 2
Read now
Unlock full access