| 243 | await asyncio.wait(tasks) |
| 244 | |
| 245 | async def restart(self) -> None: class="cm"># pragma: no cover |
| 246 | class="cm"># This coroutine may be called from a different thread than the one the |
| 247 | class="cm"># server is running on, and from an async environment that's not asyncio. |
| 248 | class="cm"># For this reason, we use an event to coordinate with the server |
| 249 | class="cm"># instead of calling shutdown()/startup() directly, and should not make |
| 250 | class="cm"># 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: class="cm"># pragma: no cover |
| 257 | while True: |