TUTORIAL数据库与缓存FETCHED

Redis Unsubscribe 命令

Redis Unsubscribe 命令 Redis 发布订阅 Redis Unsubscribe 命令用于退订给定的一个或多个频道的信息。 语法 redis Unsubscribe 命令基本语法如下: redis 127.0.0.1:6379> UNSUBSCRIBE channel [channel ...] 可用版本 >= 2.0.0 返回值 这个命令在不同的客户端中有不同的表现。 实例 ..

更新于 2026/7/16

教程详情页默认 noindex。

Redis Unsubscribe 命令

Redis 发布订阅

Redis Unsubscribe 命令用于退订给定的一个或多个频道的信息。

语法

redis Unsubscribe 命令基本语法如下:

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

可用版本

>= 2.0.0

返回值

这个命令在不同的客户端中有不同的表现。

实例

redis 127.0.0.1:6379> UNSUBSCRIBE mychannel 
1) "unsubscribe"
2) "a"
3) (integer) 0

Redis 发布订阅