Open snsinfu opened 5 years ago
At least the timeout argument for poll(2) can be -1 when queue
is empty. This way we can eliminate periodic wakeup in most common case (where watched paths exist).
The timeout optimization is implemented: 264ed6c30f9a63d6cd4f245cdef67ed3126d33ac
The v0.2.0 release uses fixed 3-second interval for detecting file creation:
https://github.com/snsinfu/ftrap/blob/v0.2.0/src/ftrap.c#L26
It should work well enough for typical server programs that just reload config file. So this is not a big problem, but shouldn’t the interval be configurable? Is there any better way than periodic polling?