watchdog.utils.event_debouncer#
- class watchdog.utils.event_debouncer.EventDebouncer(debounce_interval_seconds: int, events_callback: Callable[[list[FileSystemEvent]], None])[source]#
Bases:
BaseThreadBackground thread for debouncing event handling.
When an event is received, wait until the configured debounce interval passes before calling the callback. If additional events are received before the interval passes, reset the timer and keep waiting. When the debouncing interval passes, the callback will be called with a list of events in the order in which they were received.
- Parameters:
debounce_interval_seconds (
int) – The number of seconds to wait before calling the callback.events_callback (
Callable[[list[FileSystemEvent]], None]) – The callback function to be invoked with the debounced events.