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

debounce functionality added. Closes: #58 #65

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

abdullah2993
Copy link

Ability to debounce the events added.
Closes: #58

@abdullah2993 abdullah2993 changed the title debounce functionality added. fixes #https://github.com/radovskyb/watcher/issues/58 debounce functionality added. fixes https://github.com/radovskyb/watcher/issues/58 Jan 21, 2019
@abdullah2993 abdullah2993 changed the title debounce functionality added. fixes https://github.com/radovskyb/watcher/issues/58 debounce functionality added. Closes: #58 Jan 21, 2019
@radovskyb
Copy link
Owner

Hi @abdullah2993,

May I ask how this is different than just setting a higher polling time instead of the default 100ms? :)

@abdullah2993
Copy link
Author

@radovskyb This will be a little hard to explain but let me try. Imagine if you change 20 files and save them, the command will be executed 20 times, you can find a much better explained scenario here. With this feature you can delay the execution of the command for a specified time and consume the file change events during that period and execute the command only once. So if 20 files are changed in a very close proximity of each other the command will only be executed once.

@progrium
Copy link

Yeah, you can roughly get this from the SetMaxEvents feature assuming your filters are set up correctly to only catch actionable events. IMO debouncing isn't necessary here and if you really need it there are libraries and very short snippets to add your own debouncer.

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

Successfully merging this pull request may close these issues.

Support debouncing watch events
3 participants