BLMPOP

Since 1.1.0Lists

Syntax

BLMPOP timeout numkeys key [key ...] LEFT|RIGHT [COUNT count]
  • Flags: blocking, movablekeys, write
  • ACL categories: @blocking, @list, @slow, @write
  • Arity: -5

LMPOP that waits until one of the lists has an element, or timeout seconds have passed.

Reply

  • A two-element array: the key popped from, and the elements.
  • nil if the timeout passed.

Examples

> RPUSH b2 1 2
(integer) 2
> BLMPOP 1 2 b0 b2 LEFT COUNT 3
1) "b2"
2) 1) "1"
   2) "2"