BRPOPLPUSH(3valkey)
π 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
sourceactually has elements in it, this command behaves exactly likeRPOPLPUSH. No differences, no drama. - When you use it inside a
MULTI/EXECblock, it also behaves exactly likeRPOPLPUSH. Blocking? Not today. π - When
sourceis empty, Valkey will block the connection until some other client pushes something to it, or untiltimeoutis reached. - A
timeoutof 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 fromsourceand pushed todestination. slay β¨valkey-protocol(7)Nil reply: thetimeoutis reached. sad girl hours π
RESP3
One of the following:
valkey-protocol(7)Bulk string reply: the element being popped fromsourceand pushed todestination. same energy πvalkey-protocol(7)Null reply: thetimeoutis reached.
π₯ COMPLEXITY π₯
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:timeoutis interpreted as a double instead of an integer. glow up fr fr π
π SEE ALSO π
blmove(3valkey)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)rpoplpush(3valkey)rpush(3valkey)rpushx(3valkey)
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
- fedora 44: valkey-doc 9.0.3-2.fc44 Β· CC-BY-SA-4.0
- fedora 44: valkey-doc 9.0.6-1.fc44 Β· CC-BY-SA-4.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms