Redis - PubSub Publish Command


Advertisements

Redis PUBLISH command posts a message to a channel.

Syntax

Following is the basic syntax of Redis PUBLISH command.

redis 127.0.0.1:6379> PUBLISH channel message

Return Value

Integer reply − the number of clients that received the message.

Example

redis 127.0.0.1:6379> PUBLISH mychannel "hello, i m here" 
(integer) 1
redis_pub_sub.htm
Advertisements