2 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01//EN">
5 <link type=
"text/css" rel=
"stylesheet" href=
"style.css" />
12 <img style=
"border:none" alt=
"Redis Documentation" src=
"redis.png">
16 <div id=
"pagecontent">
18 <!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
19 <b>BrpoplpushCommand: Contents
</b><br> <a href=
"#BRPOPLPUSH _srckey_ _dstkey_ _timeout_ (Redis >">BRPOPLPUSH _srckey_ _dstkey_ _timeout_ (Redis
></a><br> <a href=
"#Return value">Return value
</a>
22 <h1 class=
"wikiname">BrpoplpushCommand
</h1>
30 <h1><a name=
"BRPOPLPUSH _srckey_ _dstkey_ _timeout_ (Redis >">BRPOPLPUSH _srckey_ _dstkey_ _timeout_ (Redis
></a></h1> 2.1.8) =
31 <i>Time complexity: O(
1)
</i><blockquote>Blocking version of the
<a href=
"RpoplpushCommand.html">RPOPLPUSH
</a> command. Atomically removes and returnsthe last element (tail) of the source list at
<i>srckey
</i>, and as a side effect pushes the returned element in the head of the list at
<i>dstkey
</i>.
</blockquote>
32 If the source list is empty, the client blocks until another client pushes against the source list. Of course in such a case the push operation against the destination list will be performed after the command unblocks detecting a push against the source list.
<br/><br/>Note that the command returns an error if the target key already exists but is not a list. The error is delayed at the time the push operation is attempted, that is, immediately if the source list is not empty, or when the first push against the source list happens in the case the command would block.
<br/><br/>The timeout value can be
0 or a positive integer value. When it is zero the command will block forever, until something is pushed against
<i>srckey
</i>. Otherwise the command will wait the specified number of seconds at max, returning an nil value when the timeout expires.
<br/><br/>The source and destination of the list can be the same, having the effect of rotating the list. Please check
<a href=
"RpoplpushCommand.html">RPOPLPUSH
</a> for more information.
<h2><a name=
"Return value">Return value
</a></h2><a href=
"ReplyTypes.html">Bulk reply
</a>