Latest web development tutorials

Redis Blpop command

Redis list (List)

Redis Blpop command and get out of the first element of the list, if the list is not a list of the elements will be blocked until a timeout or a date can be found in the pop-up element.

grammar

redis Blpop basic command syntax is as follows:

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

Available versions

> = 2.0.0

return value

If the list is empty, return a nil. Otherwise, it returns a list containing two elements, the first element is a key element belongs is ejected, the second element is the value of the element to be ejected.

Examples

redis 127.0.0.1:6379> BLPOP list1 100

In the example above, the operation will be blocked, if the first element of the list specified key list1 presence data is returned, otherwise waits for 100 seconds will return nil.

(nil)
(100.06s)

Redis list (List)