PubSub
PUBLISH
Publish a message to a channel
Arguments
channelbodystringrequired
The channel to publish to.
messagebodyTMessage
The message to publish.
Response
integerrequired
The number of clients who received the message.
Example
const listeners = await redis.publish("my-channel", "my-message");