Skip to content

Commit

Permalink
Add WAIT command for Redis synchronous replication
Browse files Browse the repository at this point in the history
ref1: https://github.com/antirez/redis/blob/unstable/src/replication.c#L1783, at SYNCHRONOUS REPLICATION
ref2: http://antirez.com/news/66
This command for Redis-3.0.0 and above now.
  • Loading branch information
eshizhan committed Jan 15, 2015
1 parent cee81bd commit ede4785
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions redis/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,15 @@ def time(self):
"""
return self.execute_command('TIME')

def wait(self, num_replicas, timeout):
"""
Redis synchronous replication
That returns the number of replicas that processed the query when
we finally have at least ``num_replicas``, or when the ``timeout`` was
reached.
"""
return self.execute_command('WAIT', num_replicas, timeout)

# BASIC KEY COMMANDS
def append(self, key, value):
"""
Expand Down

0 comments on commit ede4785

Please sign in to comment.