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/client.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/client.py')
-rwxr-xr-x | redis/client.py | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/redis/client.py b/redis/client.py index 1317cb6..22c5dc1 100755 --- a/redis/client.py +++ b/redis/client.py @@ -642,19 +642,7 @@ def parse_set_result(response, **options): return response and str_if_bytes(response) == "OK" -class Redis(RedisModuleCommands, CoreCommands, SentinelCommands): - """ - Implementation of the Redis protocol. - - This abstract class provides a Python interface to all Redis commands - and an implementation of the Redis protocol. - - Pipelines derive from this, implementing how - the commands are sent and received to the Redis server. Based on - configuration, an instance will either use a ConnectionPool, or - Connection object to talk to redis. - """ - +class AbstractRedis: RESPONSE_CALLBACKS = { **string_keys_to_dict( "AUTH COPY EXPIRE EXPIREAT PEXPIRE PEXPIREAT " @@ -807,6 +795,20 @@ class Redis(RedisModuleCommands, CoreCommands, SentinelCommands): "ZMSCORE": parse_zmscore, } + +class Redis(AbstractRedis, RedisModuleCommands, CoreCommands, SentinelCommands): + """ + Implementation of the Redis protocol. + + This abstract class provides a Python interface to all Redis commands + and an implementation of the Redis protocol. + + Pipelines derive from this, implementing how + the commands are sent and received to the Redis server. Based on + configuration, an instance will either use a ConnectionPool, or + Connection object to talk to redis. + """ + @classmethod def from_url(cls, url, **kwargs): """ |