Wait until the server is closed. When :meth:`wait_closed` returns, all TCP connections are closed and all connection handlers have returned. To ensure a fast shutdown, a connection handler should always be awaiting at least one of: * :meth:`~Server
(self)
| 487 | self.logger.info("server closed") |
| 488 | |
| 489 | async def wait_closed(self) -> None: |
| 490 | """ |
| 491 | Wait until the server is closed. |
| 492 | |
| 493 | When :meth:`wait_closed` returns, all TCP connections are closed and |
| 494 | all connection handlers have returned. |
| 495 | |
| 496 | To ensure a fast shutdown, a connection handler should always be |
| 497 | awaiting at least one of: |
| 498 | |
| 499 | * :meth:`~ServerConnection.recv`: when the connection is closed, |
| 500 | it raises :exc:`~websockets.exceptions.ConnectionClosedOK`; |
| 501 | * :meth:`~ServerConnection.wait_closed`: when the connection is |
| 502 | closed, it returns. |
| 503 | |
| 504 | Then the connection handler is immediately notified of the shutdown; |
| 505 | it can clean up and exit. |
| 506 | |
| 507 | """ |
| 508 | await asyncio.shield(self.closed_waiter) |
| 509 | |
| 510 | def get_loop(self) -> asyncio.AbstractEventLoop: |
| 511 | """ |
no outgoing calls