pop

UK[pɒp] US[pɑ:p]

vi. (unexpectedly, suddenly) appear; appear suddenly; make a popping sound; (suddenly) action

vt. (suddenly) reach out; (suddenly) ask a question; (suddenly take out something prepared); strike

n.pop music ; soda; (especially used as a title) dad; (quickly marked)

adj. pop music; popular style; popular; modern

adv. explosion; bang

abbr.post office protocol

Third person singular: pops Plural: pops Present participle: popping Past tense: popped Past participle: popped

redis BLPOP command syntax

Function: BLPOP is the blocking pop-up primitive of the list.

Syntax: BLPOP key [key ...] timeout

Description: It is the blocking version of the LPOP command. When the given list is When there are no elements to pop up, the connection will be blocked by the BLPOP command until the wait times out or a pop-up element is found. When multiple key parameters are given, each list is checked in order of parameter key and the head element of the first non-empty list pops up.

Available versions: >= 2.0.0

Time complexity: O(1)

Return: If the list is empty, return a nil. Otherwise, a list containing two elements is returned, the first element is the key to which the popped element belongs, and the second element is the value of the popped element.

redis BLPOP command example

redis> DEL job command request           # 确保key都被删除
(integer) 0
redis> LPUSH command "update system..."  # 为command列表增加一个值
(integer) 1
redis> LPUSH request "visit page"        # 为request列表增加一个值
(integer) 1
redis> BLPOP job command request 0       # job 列表为空,被跳过,紧接着 command 列表的第一个元素被弹出。
1) "command"                             # 弹出元素所属的列表
2) "update system..."                    # 弹出元素所属的值