watchdog.utils.event_debouncer#
- class watchdog.utils.event_debouncer.EventDebouncer(debounce_interval: Seconds, events_callback: Callable[[list[FileSystemEvent]], None])[source]#
- class watchdog.utils.event_debouncer.EventDebouncer(*, debounce_interval_seconds: Seconds, events_callback: Callable[[list[FileSystemEvent]], None])
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) – How long to wait before calling the callback.events_callback (
Callable[[list[FileSystemEvent]], None]) – The callback function to be invoked with the debounced events.debounce_interval_seconds (
Seconds) – Deprecated, usedebounce_intervalinstead.
- property debounce_interval_seconds: Any#
Deprecated and will be removed in 9.0.0, use
debounce_intervalinstead.