-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[QUESTION] WebSocketResponse timeout parameter #1325
Comments
You've raised very interesting and important question. The story is waiting for a hero. |
It appears that the websocket timeout is not being honored during reads. https://github.com/KeepSafe/aiohttp/blob/master/aiohttp/client_ws.py#L129 This can be worked around by wrapping the receive*_ call with asyncio.wait_for, but the websocket client should do this internally. |
Good catch. Question should we use two separate timeout parameters, one for receive and another for close or same for both? |
That is a good question. It would probably make sense to use different timeouts for close/receive. However, for backward compatibility, the existing timeout parameter would need to be used for the close timeout, since the current receive timeout is effectively infinite. So, creating a new receive_timeout parameter with a default of None (infinite) would probably be the safest approach. It would also be useful to allow passing a timeout to the receive_* function that could override the default. This would be analogous to the timeout parameter in ClientSession.request. |
added |
WebSocketResponse timeout parameter is not documented:
https://aiohttp.readthedocs.io/en/stable/web_reference.html#websocketresponse
What does it do? It's a timeout for websocket creation or for websocket messages? From source code, it seems it involves websocket closing only.
The text was updated successfully, but these errors were encountered: