w3resource

Redis Pub/Sub: PUBLISH channel message

PUBLISH channel message

Redis PUBLISH command is used to post a message to a channel.

Syntax:

PUBLISH channel message

Available since

2.0.0.

Return Value

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

Return Value Type

Integer

Example: Redis PUBLISH

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

Previous: PUBSUB
Next: PUNSUBSCRIBE



Follow us on Facebook and Twitter for latest update.