| 243 | await asyncio.wait(tasks) |
| 244 | |
| 245 | async def restart(self) -> None: # pragma: no cover |
| 246 | # This coroutine may be called from a different thread than the one the |
| 247 | # server is running on, and from an async environment that's not asyncio. |
| 248 | # For this reason, we use an event to coordinate with the server |
| 249 | # instead of calling shutdown()/startup() directly, and should not make |
| 250 | # any asyncio-specific operations. |
| 251 | self.started = False |
| 252 | self.restart_requested.set() |
| 253 | while not self.started: |
| 254 | await sleep(0.2) |
| 255 | |
| 256 | async def watch_restarts(self) -> None: # pragma: no cover |
| 257 | while True: |