BLMPOP · Valkey

BLMPOP

Pops the first element from one of multiple lists. Blocks until an element is available otherwise. Deletes the list if the last element was popped.

Usage

BLMPOP timeout numkeys key [key…] <LEFT | RIGHT> [COUNT count]

Description

BLMPOP is the blocking variant of LMPOP.

When any of the lists contains elements, this command behaves exactly like LMPOP. When used inside a MULTI/EXEC block, this command behaves exactly like LMPOP. When all lists are empty, Valkey will block the connection until another client pushes to it or until the timeout (a double value specifying the maximum number of seconds to block) elapses. A timeout of zero can be used to block indefinitely.

See LMPOP for more information.

Reply RESP2

One of the following:

Reply RESP3

One of the following:

Complexity

O(N+M) where N is the number of provided keys and M is the number of elements returned.

ACL Categories

@blocking @list @slow @write

History

See also

BLMOVE, BLPOP, BRPOP, LINDEX, LINSERT, LLEN, LMOVE, LMPOP, LPOP, LPOS, LPUSH, LPUSHX, LRANGE, LREM, LSET, LTRIM, RPOP, RPUSH, RPUSHX.