English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The Redis Blpop command removes and retrieves the first element of the list, if the list has no elements, it will block the list until the timeout is exceeded or a popable element is found.
The basic syntax of the redis Blpop command is as follows:
redis 127.0.0.1:6379> BLPOP LIST1 LIST2 .. LISTN TIMEOUT
>= 2.0.0
If the list is empty, return 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 examples, operations will be blocked, if the specified list key list1 If there is data, the first element will be returned; otherwise, it will wait.10After 0 seconds, nil will be returned.
(nil) (100.06s)