euri10
euri10
> Still best solution for me: [#652 (comment)](https://github.com/encode/starlette/issues/652#issuecomment-569327566) asgi-lifespan simplifies this a lot, it adds another dependency though
Well it handles the lifespan events you may have declared in your app
you can subclass `WebSocketEndpoint` @benfasoli , here's an example of a dummy counter ``` @app.websocket_route("/counter") class WebSocketTicks(WebSocketEndpoint): async def on_connect(self, websocket: WebSocket) -> None: await websocket.accept() self.ticker_task = asyncio.create_task(self.tick(websocket)) logger.debug("connected")...
Seems very odd to me, I don't see any reason why there would be a 50s delay Le jeu. 13 févr. 2020 à 11:24 PM, Dev Aggarwal a écrit :...
> Then just disconnect the wifi on the client. I'm not sure but is it the best way to disconnect the client ? just in case I took your example,...
understood , the 40 to 50s you see is exactly what is described here: https://github.com/aaugustin/websockets/blob/3bab7fd155636c73b79b258de752b36687bba347/src/websockets/protocol.py#L803-L810 close_timeout default to 10s so maybe setting it to a lower value might help
It would be in uvicorn, not sure there's a way to override the timeout, @tomchristie might know
is this not valid anymore https://github.com/encode/starlette/blob/master/docs/templates.md#asynchronous-template-rendering ?
I almost never used the Starlette built-in TestClient and always test things with httpx,
thanks for that @levrik we should maybe use raw_path instead of path in ``` def get_path_with_query_string(scope: WWWScope) -> str: path_with_query_string = urllib.parse.quote(scope["path"]) ```