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)命令

The Seasoned Schemer

The Seasoned Schemer

Daniel P. Friedman、Matthias Felleisen / The MIT Press / 1995-12-21 / USD 38.00

drawings by Duane Bibbyforeword and afterword by Guy L. Steele Jr.The notion that "thinking about computing is one of the most exciting things the human mind can do" sets both The Little Schemer (form......一起来看看 《The Seasoned Schemer》 这本书的介绍吧!

CSS 压缩/解压工具

CSS 压缩/解压工具

在线压缩/解压 CSS 代码

HTML 编码/解码

HTML 编码/解码

HTML 编码/解码

html转js在线工具

html转js在线工具

html转js在线工具