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