February 2018
Intermediate to advanced
382 pages
11h 33m
English
The SUBSCRIBE command is called to monitor the available messages in a specific channel. One client can subscribe many channels at one time using SUBSCRIBE, and also can subscribe channels that match a given pattern using PSUBSCRIBE. To unsubscribe channels, UNSUBSCRIBE can be used.
The PUBLISH command is for sending a message to a specific channel. All the subscribers subscribing to the channel will receive this message.
Another important command is PUBSUB, which does the channel management job. For instance, one may retrieve the current active channels by issuing the PUBSUB CHANNELS command, as follows:
127.0.0.1:6379> PUBSUB CHANNELS 1) "restaurants:Chinese" 2) "restaurants:Thai"
Read now
Unlock full access