Skip to content

Commit

Permalink
Add support for BRPOPLPUSH.
Browse files Browse the repository at this point in the history
  • Loading branch information
fatlotus committed Jul 10, 2012
1 parent a3af6cd commit c655a34
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -537,3 +537,7 @@ Thanks to (in no particular order):
- Jeethu Rao

- Contributed with test cases, and other ideas like support for travis-ci

- Jeremy Archer

- Minor bugfixes.
9 changes: 8 additions & 1 deletion txredisapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,14 @@ def brpop(self, keys, timeout=0):

keys.append(timeout)
return self.execute_command("BRPOP", *keys)


def brpoplpush(self, source, destination):
"""
Pop a value from a list, push it to another list and return
it; or block until one is available.
"""
return self.execute_command("BRPOPLPUSH", source, destination)

def rpoplpush(self, srckey, dstkey):
"""
Return and remove (atomically) the last element of the source
Expand Down

0 comments on commit c655a34

Please sign in to comment.