emcrisostomo / fswatch

A cross-platform file change monitor with multiple backends: Apple OS X File System Events, *BSD kqueue, Solaris/Illumos File Events Notification, Linux inotify, Microsoft Windows and a stat()-based backend.
https://emcrisostomo.github.io/fswatch/
GNU General Public License v3.0
4.96k stars 327 forks source link

Add option for a separate idle event timeout #289

Open jarruda opened 2 years ago

jarruda commented 2 years ago

The --fire-idle-event option uses a period of 110% of the latency period. Reference

I would like to be able to set a different period for the idle event that is not based on the latency.

Use case: My application uses the latency option to debounce several changes made in quick succession, and would like to use the idle period to perform maintenance activities. The scale of these two operations are an order of magnitude apart (5s vs 60s). My application uses fswatch to sleep for the majority of the time and only wake on file changes. If the idle event fires at roughly the latency period, then fswatch provides almost no value for my use case (I don't need to know which files changed).

An acceptable solution:

emcrisostomo commented 2 years ago

Thanks for the comment @jarruda, I'll look into this.