From f704281cf4c1f735c06a13946fcea42fa939e3a5 Mon Sep 17 00:00:00 2001 From: Utkarsh Gupta Date: Mon, 30 May 2022 19:04:06 +0530 Subject: 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 --- redis/asyncio/connection.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'redis/asyncio/connection.py') 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) -- cgit v1.2.1