English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The Redis Blpop command removes and retrieves the first element from the list, if the list has no elements, it will block the list until the timeout or an element to pop is found.
Basic Syntax of Redis Blpop Command
redis 127.0.0.1:6379> BLPOP LIST1 LIST2 .. LISTN TIMEOUT
>= 2.0.0
If the list is empty, return a nil. Otherwise, return a list containing two elements, the first element is the key of the popped element, and the second element is the value of the popped element.
redis 127.0.0.1:6379> BLPOP list1 100
In the above example, the operation will be blocked, if the specified list key list1 If there is data, the first element will be returned, otherwise wait10Will return nil after 0 seconds.
(nil) (100.06s)