BLMOVE(3valkey)

πŸ“¦
version 9.0.6 Β· 2 versions
, in fedora 44

πŸ’– BLMOVE (from the 3valkey manual, bestie) πŸ’–


✨ NAME ✨

blmove β€” pops an element off one list, shoves it onto another list, and hands it back to you. If there's nothing to pop, she waits. And if you just moved the very last element out of that list? The list gets deleted. Gone. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

BLMOVE source destination <LEFT | RIGHT> <LEFT | RIGHT> timeout

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so BLMOVE is literally the blocking version of valkey-lmove(7) LMOVE. Same girl, but she's willing to wait. ⏳

  • When source actually has elements in it, this command behaves exactly like LMOVE. No difference, no notes. ✨
  • When you run it inside a valkey-multi(7) MULTI / valkey-exec(7) EXEC block, it also behaves exactly like LMOVE. (No blocking in there, bestie β€” she can't just sit around mid-transaction.)
  • When source is empty, Valkey blocks the connection until another client pushes something into it, or until timeout hits. And timeout is a double value, meaning it's the max number of seconds to block for. πŸ•°οΈ
  • A timeout of zero = block indefinitely. Like, forever-forever. Choose wisely. 😭

This command exists to replace the now deprecated valkey-brpoplpush(7) BRPOPLPUSH. Doing BLMOVE RIGHT LEFT is equivalent. πŸ‘‘

Want more info? Go read valkey-lmove(7) LMOVE.

🌈 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)

Constant time, queen. She's efficient AND she waits. Main character energy fr fr. πŸ‘‘


πŸ’… ACL CATEGORIES πŸ’…

@blocking @list @slow @write


πŸŽ€ HISTORY πŸŽ€

  • Available since: 6.2.0

🧚 SEE ALSO 🧚

blmpop(3valkey), blpop(3valkey), brpop(3valkey), brpoplpush(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), rpoplpush(3valkey), rpush(3valkey), rpushx(3valkey)


And that's the whole page, bestie!! πŸ’œ This was version 9.0.0, dated 2025-10-21 β€” so you know it's fresh. Now go move some list elements, mwah. πŸ˜˜πŸ¦‹βœ¨

πŸ“¦ where this page comes from