Read and discard notifications for *seconds*.
(self, seconds: float)
| 366 | raise TimeoutError(f"Indexing did not finish within {timeout}s") |
| 367 | |
| 368 | def drain_notifications(self, seconds: float) -> None: |
| 369 | """Read and discard notifications for *seconds*.""" |
| 370 | deadline = time.monotonic() + seconds |
| 371 | while time.monotonic() < deadline: |
| 372 | remaining = deadline - time.monotonic() |
| 373 | if remaining <= 0: |
| 374 | break |
| 375 | try: |
| 376 | self._notifications.get(timeout=min(remaining, 0.5)) |
| 377 | except queue.Empty: |
| 378 | pass |
| 379 | |
| 380 | def shutdown(self) -> None: |
| 381 | """Send shutdown + exit.""" |
no test coverage detected