diff options
author | Andy McCurdy <andy@andymccurdy.com> | 2015-01-16 12:45:18 -0800 |
---|---|---|
committer | Andy McCurdy <andy@andymccurdy.com> | 2015-01-16 12:45:18 -0800 |
commit | c4e2f56dbf6e04a23e6a346ac54278cfbf4035e1 (patch) | |
tree | 3713149076766a6e8d45a2e19595cb1ab068b967 | |
parent | cee81bd7ea1c4c5f00ac91b8d70b10eccd31dd0c (diff) | |
parent | ede4785969e88db7b08594b7c4fdc5323ed754f7 (diff) | |
download | redis-py-c4e2f56dbf6e04a23e6a346ac54278cfbf4035e1.tar.gz |
Merge pull request #580 from eshizhan/master
Add WAIT command for Redis synchronous replication
-rwxr-xr-x | redis/client.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/redis/client.py b/redis/client.py index c99b817..8b5a3fa 100755 --- a/redis/client.py +++ b/redis/client.py @@ -767,6 +767,15 @@ class StrictRedis(object): """ 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): """ |