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..."                    # 彈出元素所屬的值