MCPcopy Index your code
hub / github.com/python-websockets/websockets / wait_closed

Method wait_closed

src/websockets/asyncio/server.py:489–508  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 """

Callers 15

__aexit__Method · 0.95
handlerFunction · 0.45
watchFunction · 0.45
mainFunction · 0.45
watchFunction · 0.45
serverFunction · 0.45
noopFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45

Calls

no outgoing calls