Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polling interval for file creation #4

Open
snsinfu opened this issue Sep 9, 2019 · 2 comments
Open

Polling interval for file creation #4

snsinfu opened this issue Sep 9, 2019 · 2 comments
Labels
YAGNI Hypothetically useful enhancement idea

Comments

@snsinfu
Copy link
Owner

snsinfu commented Sep 9, 2019

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?

@snsinfu snsinfu added the YAGNI Hypothetically useful enhancement idea label Sep 9, 2019
@snsinfu
Copy link
Owner Author

snsinfu commented Sep 9, 2019

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).

@snsinfu
Copy link
Owner Author

snsinfu commented Sep 9, 2019

The timeout optimization is implemented: 264ed6c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
YAGNI Hypothetically useful enhancement idea
Projects
None yet
Development

No branches or pull requests

1 participant