Stop the client. If the client is connected to a server, it is disconnected. If the client is attempting to reconnect to server, the reconnection attempts are stopped. If the client is not connected to a server and is not attempting to reconnect, then this function d
(self)
| 332 | await self.eio.disconnect() |
| 333 | |
| 334 | async def shutdown(self): |
| 335 | """Stop the client. |
| 336 | |
| 337 | If the client is connected to a server, it is disconnected. If the |
| 338 | client is attempting to reconnect to server, the reconnection attempts |
| 339 | are stopped. If the client is not connected to a server and is not |
| 340 | attempting to reconnect, then this function does nothing. |
| 341 | """ |
| 342 | if self.connected: |
| 343 | await self.disconnect() |
| 344 | elif self._reconnect_task: # pragma: no branch |
| 345 | self._reconnect_abort.set() |
| 346 | await self._reconnect_task |
| 347 | |
| 348 | def start_background_task(self, target, *args, **kwargs): |
| 349 | """Start a background task using the appropriate async model. |