# BRPOPLPUSH

> Move the last element of a list to the head of another, waiting until one is available (older form of BLMOVE).

URL: https://docs.hotkv.com/commands/brpoplpush/

```
BRPOPLPUSH source destination timeout
```

- Group: List
- Complexity: O(1)
- HotKV Cloud: all plans
- On-Premise: no license needed
- Deprecated: use BLMOVE instead

`BRPOPLPUSH` is the blocking form of [RPOPLPUSH](https://docs.hotkv.com/commands/rpoplpush/index.md), and
is the same as `BLMOVE source destination RIGHT LEFT timeout`. New code should
use [BLMOVE](https://docs.hotkv.com/commands/blmove/index.md).

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](https://docs.hotkv.com/commands/multi/index.md) /
[EXEC](https://docs.hotkv.com/commands/exec/index.md) and inside scripts it never waits.

## 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`, 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.

## Examples

```
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"
```

## Compatibility

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

## See also

[BLMOVE](https://docs.hotkv.com/commands/blmove/index.md), [RPOPLPUSH](https://docs.hotkv.com/commands/rpoplpush/index.md), [LMOVE](https://docs.hotkv.com/commands/lmove/index.md)