| Conditions | 3 |
| Total Lines | 17 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import json |
||
| 21 | async def handle_websocket_request(self, http_request: web.Request) -> web_ws.WebSocketResponse: |
||
| 22 | http_request.msg_id = 0 |
||
| 23 | http_request.pending = {} |
||
| 24 | |||
| 25 | ws = web_ws.WebSocketResponse() |
||
| 26 | await ws.prepare(http_request) |
||
| 27 | http_request.ws = ws |
||
| 28 | |||
| 29 | while not ws.closed: |
||
| 30 | ws_msg = await ws.receive() |
||
| 31 | |||
| 32 | if ws_msg.type != aiohttp.WSMsgType.TEXT: |
||
| 33 | continue |
||
| 34 | |||
| 35 | await self._handle_ws_msg(http_request, ws_msg) |
||
| 36 | |||
| 37 | return ws |
||
| 38 | |||
| 48 |