diff options
author | Utkarsh Gupta <utkarshgupta137@gmail.com> | 2022-05-30 19:04:06 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-30 16:34:06 +0300 |
commit | f704281cf4c1f735c06a13946fcea42fa939e3a5 (patch) | |
tree | 85a7affc680058b54d1df30d65e1f97c44c08847 /redis/asyncio/connection.py | |
parent | 48079083a7f6ac1bdd948c03175f9ffd42aa1f6b (diff) | |
download | redis-py-f704281cf4c1f735c06a13946fcea42fa939e3a5.tar.gz |
async_cluster: add/update typing (#2195)
* async_cluster: add/update typing
* async_cluster: update cleanup_kwargs with kwargs from async Connection
* async_cluster: properly remove old nodes
Diffstat (limited to 'redis/asyncio/connection.py')
-rw-r--r-- | redis/asyncio/connection.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/redis/asyncio/connection.py b/redis/asyncio/connection.py index 9de2d46..d9b0974 100644 --- a/redis/asyncio/connection.py +++ b/redis/asyncio/connection.py @@ -684,7 +684,7 @@ class Connection: def clear_connect_callbacks(self): self._connect_callbacks = [] - def set_parser(self, parser_class): + def set_parser(self, parser_class: Type[BaseParser]) -> None: """ Creates a new instance of parser_class with socket size: _socket_read_size and assigns it to the parser for the connection @@ -766,7 +766,7 @@ class Connection: f"{exception.args[0]}." ) - async def on_connect(self): + async def on_connect(self) -> None: """Initialize the connection, authenticate and select a database""" self._parser.on_connect(self) @@ -807,7 +807,7 @@ class Connection: if str_if_bytes(await self.read_response()) != "OK": raise ConnectionError("Invalid Database") - async def disconnect(self): + async def disconnect(self) -> None: """Disconnects from the Redis server""" try: async with async_timeout.timeout(self.socket_connect_timeout): @@ -891,7 +891,7 @@ class Connection: await self.disconnect() raise - async def send_command(self, *args, **kwargs): + async def send_command(self, *args: Any, **kwargs: Any) -> None: """Pack and send a command to the Redis server""" await self.send_packed_command( self.pack_command(*args), check_health=kwargs.get("check_health", True) |