BRPOPLPUSH
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.
Return value
Section titled “Return value”| 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, orERR timeout is out of rangefor a badtimeout.WRONGTYPEifsourceis not a list, ordestinationexists and is not a list when an element is moved.
Examples
Section titled “Examples”127.0.0.1:6379> RPUSH src a b(integer) 2127.0.0.1:6379> BRPOPLPUSH src dst 5"b"127.0.0.1:6379> LRANGE dst 0 -11) "b"Compatibility
Section titled “Compatibility”Same as Redis 7.4 and Valkey 8, where it is also deprecated in favour of
BLMOVE.
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.