BLMPOP

Syntax
BLMPOP timeout numkeys key [key ...] <LEFT | RIGHT> [COUNT count]
Available since:
7.0.0
Time complexity:
O(N+M) where N is the number of provided keys and M is the number of elements returned.
ACL categories:
@write, @list, @slow, @blocking,

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, Redis 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.

RESP2 Reply

One of the following:

  • Nil reply: when no element could be popped and the timeout is reached.
  • Array reply: a two-element array with the first element being the name of the key from which elements were popped, and the second element being an array of the popped elements.

RESP3 Reply

One of the following:

  • Null reply: when no element could be popped and the timeout is reached.
  • Array reply: a two-element array with the first element being the name of the key from which elements were popped, and the second element being an array of the popped elements.

Rate this page