Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Redis Unsubscribe Command

Redis Unsubscribe Command

Redis Publish/Subscribe

The Redis Unsubscribe command is used to unsubscribe from messages of one or more given channels.

Syntax

The basic syntax of the redis Unsubscribe command is as follows:



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

Available Version

= 2.0.0

Return Value

This command behaves differently across different clients.

Example



redis 127.0.0.1:6379> UNSUBSCRIBE mychannel 

1) "unsubscribe"

2) "a"

3) (integer) 0

Redis Publish/Subscribe