Signal the background thread to stop and wait briefly for it.
(self, timeout: float = 2.0)
| 65 | self._loaded.clear() |
| 66 | |
| 67 | def stop(self, timeout: float = 2.0) -> None: |
| 68 | """Signal the background thread to stop and wait briefly for it.""" |
| 69 | if self._thread and self._thread.is_alive(): |
| 70 | self._cancel.set() |
| 71 | self._thread.join(timeout=timeout) |
| 72 | self._cancel = threading.Event() |
| 73 | self._thread = None |
| 74 | |
| 75 | def start_configured(self) -> None: |
| 76 | """Start prefetching based on the user's prefetch settings.""" |