-
Notifications
You must be signed in to change notification settings - Fork 167
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
debounce timing #142
base: master
Are you sure you want to change the base?
debounce timing #142
Conversation
These tests were for specific cases handled by private methods that have now been removed and therefore these tests should be removed.
Just a note, it cant fix EMFILE errors for file watchers but it will help mitigate EMFILE errors with other file operations, ie readdir.
Set min required Windows to Vista
fix this.watched
Update README.md
Prevent race condition (fixes shama#134)
Thanks for the PR! I'll look into this shortly. |
Just wondering if there is a plan to address this issue. Sounds like a pretty serious issue if an event is not issued immediately after the last change. It does seem like a shame not to just use lodash/underscore debounce but I understand if you want to avoid extra dependencies. Thanks. |
@expectlabs-andrew I haven't had time to address this. Currently it fails test (and now has a merge conflict). I don't think this issue is that serious though. It already does debounce just not the exact time the OP wants. FWIW, I'd prefer to not do this internally and let users choose how/if they want to debounce. So this is not a high priority for me but if someone else wanted to fix this to not fail tests I'd be happy to merge. |
Thanks for the update. Debouncing locally is by fine, but this worried me enough to go back to |
Hi, I encountered a problem that when a file under watch is modified many times successively in a short period (e.g. building a file by appending), there may be a situation that the "changed" event is not emitted after the last modification ocurred. So the callback function cannot see the "final content" of the file.
This seems because that when an event ocurred, next events are blocked for
debounceDelay
ms. So I added a code trying to emit the event after the last filesystem event, even if emitting was blocked by previous event's delay.I wonder if this is a good solution, but I'm glad if you take a look at it. Thanks.