BRPOPLPUSH(3valkey)

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

πŸ’… BRPOPLPUSH β€” the valkey command manual, but make it cute

okay bestie, welcome to the Valkey Command Manual entry for BRPOPLPUSH, and no this is not a typo, that's genuinely the name, we don't make the rules 🫢


✨ NAME ✨

brpoplpush β€” pops an element off a list, yeets it onto another list, and hands it back to you. If there's nothing there, it just blocks and waits. And if you took the last element? The list gets deleted. bye girl πŸ’€


🌸 SYNOPSIS 🌸

BRPOPLPUSH source destination timeout

πŸ¦‹ DESCRIPTION πŸ¦‹

So BRPOPLPUSH is literally just the blocking version of RPOPLPUSH, like they're sisters fr fr.

  • When source actually has elements in it, this command behaves exactly like RPOPLPUSH. No differences, no drama.
  • When you use it inside a MULTI/EXEC block, it also behaves exactly like RPOPLPUSH. Blocking? Not today. πŸ‘‘
  • When source is empty, Valkey will block the connection until some other client pushes something to it, or until timeout is reached.
  • A timeout of zero? That means block indefinitely. main character energy, it will wait forever for you 😭
Lowkey important: check out RPOPLPUSH for more info, that's where all the real lore lives.

πŸ’« Pattern: Reliable queue

Please see the pattern description in the RPOPLPUSH documentation. (not me redirecting you, it's just canon iykyk)

πŸŽ€ Pattern: Circular list

Please see the pattern description in the RPOPLPUSH documentation. (same vibe, same homework, bestie)

🌈 Alternative

BLMOVE with the RIGHT and LEFT arguments. it's giving upgraded, but you do you πŸ’–


πŸ’Œ REPLY πŸ’Œ

RESP2

One of the following, bestie:

  • valkey-protocol(7) Bulk string reply: the element being popped from source and pushed to destination. slay ✨
  • valkey-protocol(7) Nil reply: the timeout is reached. sad girl hours 😭

RESP3

One of the following:


πŸ”₯ COMPLEXITY πŸ”₯

O(1)

constant time, she's efficient, she's iconic, periodt.


πŸ‘‘ ACL CATEGORIES πŸ‘‘

@blocking @list @slow @write


🧚 HISTORY 🧚

  • Available since: 2.2.0 β€” an elder, a legend, respect her
  • Changed in 6.0.0: timeout is interpreted as a double instead of an integer. glow up fr fr πŸ’…

πŸ“ SEE ALSO πŸ“

go read them, they're all in the group chat 🌸


and that's the whole page bestie!! this was version 9.0.0, dated 2025-10-21, from the valkey manual β€” mwah, tysm for reading, you ate that πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«Ά

πŸ“¦ where this page comes from