Close the WebSocket connection
(self)
| 233 | return params |
| 234 | |
| 235 | async def close(self) -> None: |
| 236 | """Close the WebSocket connection""" |
| 237 | if not self.is_closed: |
| 238 | try: |
| 239 | await self.websocket.close() |
| 240 | except ( |
| 241 | ConnectionClosedOK, |
| 242 | ConnectionClosedError, |
| 243 | RuntimeError, |
| 244 | WebSocketDisconnect, |
| 245 | ): |
| 246 | pass # Already closed by client |
| 247 | self.is_closed = True |
| 248 | |
| 249 | |
| 250 | @dataclass |
no outgoing calls