Redis - List Blpop Command



Redis BLPOP command is used to remove and get the first element in a list, or block until one is available. BLPOP command just returns the first element, if available, or blocks the client for specific time to execute any command.

Return Value

String reply, the value of element stored at the key or nil.

Syntax

Following is the basic syntax of Redis BLPOP command.

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

Example

redis 127.0.0.1:6379> BLPOP list1 100 

The above example will block the client for 100 seconds to execute any command. If any data comes in the specified key list1, then it returns; otherwise after 100 seconds nil value is returned.

(nil) 
(100.06s) 
redis_lists.htm
Advertisements