Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

BRPOPLPUSH

Last updated

Deprecated: use BLMOVE instead.

BRPOPLPUSH source destination timeout
Group
List
Complexity
O(1)
Arity
4 (exactly, counting the command name)
Flags
write, blocking
Keys
first 1, last 2, step 1
HotKV Cloud
All plans
On-Premise
no license needed

BRPOPLPUSH is the blocking form of RPOPLPUSH, and is the same as BLMOVE source destination RIGHT LEFT timeout. New code should use BLMOVE.

If source has an element, its last element is moved to the head of destination at once. Otherwise the connection waits until source receives an element or timeout passes. timeout is in seconds, can have a fractional part, and 0 waits forever. Inside MULTI / EXEC and inside scripts it never waits.

Case RESP2 RESP3
Moved Bulk string: the element that was moved Same
Timeout expired Nil bulk string Null

Errors:

  • ERR timeout is not a float or out of range, ERR timeout is negative, or ERR timeout is out of range for a bad timeout.
  • WRONGTYPE if source is not a list, or destination exists and is not a list when an element is moved.
127.0.0.1:6379> RPUSH src a b
(integer) 2
127.0.0.1:6379> BRPOPLPUSH src dst 5
"b"
127.0.0.1:6379> LRANGE dst 0 -1
1) "b"

Same as Redis 7.4 and Valkey 8, where it is also deprecated in favour of BLMOVE.

BLMOVE, RPOPLPUSH, LMOVE