From 985d07e36fd72b9d8a016d0a52ea64aa3d218ea6 Mon Sep 17 00:00:00 2001 From: Pietro Saccardi Date: Mon, 29 Jul 2024 23:25:58 +0200 Subject: [PATCH] Remove WebsocketRPCEndpoint.on_connect This method is never called and unused, likely left out from the cleanup after setting up RpcChannel.register_connect_handler (see for example a471d5488da07f54b1d559d009c51b56187c997b). --- fastapi_websocket_rpc/websocket_rpc_endpoint.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/fastapi_websocket_rpc/websocket_rpc_endpoint.py b/fastapi_websocket_rpc/websocket_rpc_endpoint.py index 4197728..28ef5b1 100644 --- a/fastapi_websocket_rpc/websocket_rpc_endpoint.py +++ b/fastapi_websocket_rpc/websocket_rpc_endpoint.py @@ -107,14 +107,6 @@ async def handle_disconnect(self, websocket, channel): self.manager.disconnect(websocket) await channel.on_disconnect() - async def on_connect(self, channel, websocket): - """ - Called upon new client connection - """ - # Trigger connect callback if available - if (self._on_connect is not None): - asyncio.create_task(self._on_connect(channel, websocket)) - def register_route(self, router, path="/ws"): """ Register this endpoint as a default websocket route on the given router