BRPOP

Since 1.1.0Lists

Syntax

BRPOP key [key ...] timeout
  • Flags: blocking, write
  • ACL categories: @blocking, @list, @slow, @write
  • Arity: -3

Like BLPOP, but pops the last element.

Reply

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

Examples

> RPUSH b1 x y
(integer) 2
> BRPOP b1 1
1) "b1"
2) "y"