Latest web development tutorials

Redis Subscribe command

Redis publish and subscribe

Redis Subscribe Subscribe command information given for one or more channels. .

grammar

redis Subscribe basic command syntax is as follows:

redis 127.0.0.1:6379> SUBSCRIBE channel [channel ...]

Available versions

> = 2.0.0

return value

Received information

Examples

redis 127.0.0.1:6379> SUBSCRIBE mychannel 
Reading messages... (press Ctrl-C to quit)
1) "subscribe"
2) "mychannel"
3) (integer) 1
1) "message"
2) "mychannel"
3) "a"

Redis publish and subscribe