Redis Blpop 命令

更新时间: 2019-07-07 15:54

Redis Blpop 命令移出并获取列表的第一个元素, 如果列表没有元素会阻塞列表直到等待超时或发现可弹出元素为止。

语法

redis 127.0.0.1:6379> BLPOP LIST1 LIST2 .. LISTN TIMEOUT

返回值

如果列表为空,返回一个 nil 。 否则,返回一个含有两个元素的列表,第一个元素是被弹出元素所属的 key ,第二个元素是被弹出元素的值。

实例

redis 127.0.0.1:6379> BLPOP list1 100

在以上实例中,操作会被阻塞,如果指定的列表 key list1 存在数据则会返回第一个元素,否则在等待100秒后会返回 nil 。

(nil)
(100.06s)

查看更多 Redis 列表(List)命令

Weaving the Web

Weaving the Web

Tim Berners-Lee / Harper Paperbacks / 2000-11-01 / USD 15.00

Named one of the greatest minds of the 20th century by Time , Tim Berners-Lee is responsible for one of that century's most important advancements: the world wide web. Now, this low-profile genius-wh......一起来看看 《Weaving the Web》 这本书的介绍吧!

CSS 压缩/解压工具

CSS 压缩/解压工具

在线压缩/解压 CSS 代码

HTML 编码/解码

HTML 编码/解码

HTML 编码/解码

HSV CMYK 转换工具

HSV CMYK 转换工具

HSV CMYK互换工具