0
0
Redisquery~5 mins

SUBSCRIBE to channels in Redis - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the Redis SUBSCRIBE command do?
The SUBSCRIBE command listens to messages published on one or more channels. It allows a client to receive messages sent to those channels in real time.
Click to reveal answer
beginner
How do you subscribe to multiple channels in Redis?
You list all channel names after the SUBSCRIBE command, separated by spaces. For example: SUBSCRIBE channel1 channel2 subscribes to both channels.
Click to reveal answer
intermediate
What happens to a Redis client after it issues a SUBSCRIBE command?
The client enters a listening mode and can only receive messages from subscribed channels. It cannot run other commands until it unsubscribes.
Click to reveal answer
beginner
How does Redis deliver messages to subscribed clients?
When a message is published to a channel, Redis sends the message to all clients subscribed to that channel immediately.
Click to reveal answer
beginner
What command do you use to stop listening to channels in Redis?
You use the UNSUBSCRIBE command to stop receiving messages from channels you subscribed to.
Click to reveal answer
What does the Redis SUBSCRIBE command do?
AListens for messages on specified channels
BDeletes a channel
CPublishes a message to a channel
DCreates a new database
After subscribing to channels, what can a Redis client do?
ADelete channels
BRun any Redis command freely
CPublish messages to channels
DOnly receive messages from subscribed channels
How do you subscribe to multiple channels at once?
AUse multiple <code>SUBSCRIBE</code> commands
BList all channel names after one <code>SUBSCRIBE</code> command
CUse <code>PUBLISH</code> command
DUse <code>UNSUBSCRIBE</code> command
Which command stops a client from listening to channels?
APUBLISH
BSTOP
CUNSUBSCRIBE
DDISCONNECT
What happens when a message is published to a channel?
ARedis sends the message to all subscribed clients immediately
BRedis deletes the channel
CRedis stores the message permanently
DRedis ignores the message
Explain how the Redis SUBSCRIBE command works and what happens to the client after subscribing.
Think about how a radio listens to stations and cannot do other things at the same time.
You got /3 concepts.
    Describe how to subscribe to multiple channels and how messages are delivered to subscribed clients.
    Imagine tuning into several radio stations and hearing all broadcasts live.
    You got /2 concepts.