blmove.3valkey - Man Page
Pops an element from a list, pushes it to another list and returns it. Blocks until an element is available otherwise. Deletes the list if the last element was moved.
Synopsis
BLMOVE
source destination <LEFT
| RIGHT
> <LEFT
| RIGHT
> timeout
Description
BLMOVE
is the blocking variant of LMOVE
. When source
contains elements, this command behaves exactly like LMOVE
. When used inside a MULTI
/EXEC
block, this command behaves exactly like LMOVE
. When source
is empty, Valkey will block the connection until another client pushes to it or until timeout
(a double value specifying the maximum number of seconds to block) is reached. A timeout
of zero can be used to block indefinitely.
This command comes in place of the now deprecated BRPOPLPUSH
. Doing BLMOVE RIGHT LEFT
is equivalent.
See LMOVE
for more information.
Pattern: Reliable queue
Please see the pattern description in the LMOVE
documentation.
Pattern: Circular list
Please see the pattern description in the LMOVE
documentation.
Reply
Resp2
One of the following:
- valkey-protocol(7) Bulk string reply: the element being popped from the source and pushed to the destination.
- valkey-protocol(7) Nil reply: the operation timed-out
Resp3
One of the following:
- valkey-protocol(7) Bulk string reply: the element being popped from the source and pushed to the destination.
- valkey-protocol(7) Null reply: the operation timed-out
Complexity
O(1)
Acl Categories
@blocking @list @slow @write
History
- Available since: 6.2.0
See Also
blmpop(3valkey), blpop(3valkey), brpop(3valkey), lindex(3valkey), linsert(3valkey), llen(3valkey), lmove(3valkey), lmpop(3valkey), lpop(3valkey), lpos(3valkey), lpush(3valkey), lpushx(3valkey), lrange(3valkey), lrem(3valkey), lset(3valkey), ltrim(3valkey), rpop(3valkey), rpush(3valkey), rpushx(3valkey)