Skip to content
Browse files

Added a low-level wrapper over BRPOP.

  • Loading branch information...
1 parent 7e3efa5 commit 31cb83d5fb7af8b30987183358b7cde1920059a7 @rlotun rlotun committed May 19, 2011
Showing with 9 additions and 0 deletions.
  1. +9 −0 txredis/protocol.py
View
9 txredis/protocol.py
@@ -724,6 +724,15 @@ def pop(self, key, tail=False):
self._send('RPOP' if tail else 'LPOP', key)
return self.getResponse()
+ def brpop(self, keys, timeout=30):
+ """
+ Issue a BRPOP - blockling list pop from the right.
+ @param keys is a list of one or more Redis keys
+ @param timeout max number of seconds to block for
+ """
+ self._send('BRPOP', *(list(keys) + [str(timeout)]))
+ return self.getResponse()
+
def bpop(self, keys, tail=False, timeout=30):
"""
@param keys a list of one or more Redis keys of non-empty list(s)

0 comments on commit 31cb83d

Please sign in to comment.
Something went wrong with that request. Please try again.