Cancel any existing timer and start a fresh debounce timer.
(self)
| 39 | self._lock = threading.Lock() |
| 40 | |
| 41 | def _schedule_flush(self) -> None: |
| 42 | """Cancel any existing timer and start a fresh debounce timer.""" |
| 43 | with self._lock: |
| 44 | if self._timer is not None: |
| 45 | self._timer.cancel() |
| 46 | self._timer = threading.Timer(self._debounce_seconds, self._flush) |
| 47 | self._timer.daemon = True |
| 48 | self._timer.start() |
| 49 | |
| 50 | def _flush(self) -> None: |
| 51 | """Call the callback with all collected pending paths, then clear.""" |