diff options
author | Andrew Chen Wang <60190294+Andrew-Chen-Wang@users.noreply.github.com> | 2022-02-22 05:29:55 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-22 12:29:55 +0200 |
commit | d56baeb683fc1935cfa343fa2eeb0fa9bd955283 (patch) | |
tree | 47357a74bf1d1428cfbcf0d8b2c781f1f971cf77 /redis/commands/sentinel.py | |
parent | e3c989d93e914e6502bd5a72f15ded49a135c5be (diff) | |
download | redis-py-d56baeb683fc1935cfa343fa2eeb0fa9bd955283.tar.gz |
Add Async Support (#1899)
Co-authored-by: Chayim I. Kirshen <c@kirshen.com>
Co-authored-by: dvora-h <dvora.heller@redis.com>
Diffstat (limited to 'redis/commands/sentinel.py')
-rw-r--r-- | redis/commands/sentinel.py | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/redis/commands/sentinel.py b/redis/commands/sentinel.py index a9b06c2..e054ec6 100644 --- a/redis/commands/sentinel.py +++ b/redis/commands/sentinel.py @@ -8,39 +8,39 @@ class SentinelCommands: """ def sentinel(self, *args): - "Redis Sentinel's SENTINEL command." + """Redis Sentinel's SENTINEL command.""" warnings.warn(DeprecationWarning("Use the individual sentinel_* methods")) def sentinel_get_master_addr_by_name(self, service_name): - "Returns a (host, port) pair for the given ``service_name``" + """Returns a (host, port) pair for the given ``service_name``""" return self.execute_command("SENTINEL GET-MASTER-ADDR-BY-NAME", service_name) def sentinel_master(self, service_name): - "Returns a dictionary containing the specified masters state." + """Returns a dictionary containing the specified masters state.""" return self.execute_command("SENTINEL MASTER", service_name) def sentinel_masters(self): - "Returns a list of dictionaries containing each master's state." + """Returns a list of dictionaries containing each master's state.""" return self.execute_command("SENTINEL MASTERS") def sentinel_monitor(self, name, ip, port, quorum): - "Add a new master to Sentinel to be monitored" + """Add a new master to Sentinel to be monitored""" return self.execute_command("SENTINEL MONITOR", name, ip, port, quorum) def sentinel_remove(self, name): - "Remove a master from Sentinel's monitoring" + """Remove a master from Sentinel's monitoring""" return self.execute_command("SENTINEL REMOVE", name) def sentinel_sentinels(self, service_name): - "Returns a list of sentinels for ``service_name``" + """Returns a list of sentinels for ``service_name``""" return self.execute_command("SENTINEL SENTINELS", service_name) def sentinel_set(self, name, option, value): - "Set Sentinel monitoring parameters for a given master" + """Set Sentinel monitoring parameters for a given master""" return self.execute_command("SENTINEL SET", name, option, value) def sentinel_slaves(self, service_name): - "Returns a list of slaves for ``service_name``" + """Returns a list of slaves for ``service_name``""" return self.execute_command("SENTINEL SLAVES", service_name) def sentinel_reset(self, pattern): @@ -91,3 +91,9 @@ class SentinelCommands: completely missing. """ return self.execute_command("SENTINEL FLUSHCONFIG") + + +class AsyncSentinelCommands(SentinelCommands): + async def sentinel(self, *args) -> None: + """Redis Sentinel's SENTINEL command.""" + super().sentinel(*args) |