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

Support file system notifications #89

Open
vasu-dasari opened this issue Jul 13, 2020 · 0 comments
Open

Support file system notifications #89

vasu-dasari opened this issue Jul 13, 2020 · 0 comments

Comments

@vasu-dasari
Copy link
Contributor

Currently sync polls directories and files for any changes and recompile the changed files and loads them. When sync starts monitoring more projects under one umbrella CPU can get overwhelmed with this polling. it will be good if sync looks for file system changes notifications and act upon them.

There is a project synrc/fs which provides filesystem change events. This supports Mac, Windows and Linux platforms. It would be good to integrate with this.

vasu-dasari added a commit to vasu-dasari/sync that referenced this issue Jul 13, 2020
Issue has been detailed at: rustyio#89

Currently sync polls directories and files for any changes and recompile the changed files and loads them. When sync starts monitoring more projects under one umbrella CPU can get overwhelmed with this polling. it will be good if sync looks for file system changes notifications and act upon them.

There is a project synrc/fs which provides filesystem change events. This supports Mac, Windows and Linux platforms.

This commit integrates sync with fs. Here is what it does:

1. Added a new app evnironment variable, sync_method. User can specifiy this to scanner or fsevents. By default it will be scanner, which would retain current behavior. If user specifies fsevents, new logic kicks in.
2. discover_src_dirs, will discover all source directories as requested by user. and starts fs process for monited directories.
3. When a source file or a header file changes, sync gets {fs,file_event} event. And it will handle the changed files a second later so that it can suppress/collect all events on a file.
4. Make sure no timers are active in stable state.

Signed-off-by: Vasu Dasari <[email protected]>
vasu-dasari added a commit to vasu-dasari/sync that referenced this issue Jul 13, 2020
Issue has been detailed at: rustyio#89

Currently sync polls directories and files for any changes and recompile the changed files and loads them. When sync starts monitoring more projects under one umbrella CPU can get overwhelmed with this polling. it will be good if sync looks for file system changes notifications and act upon them.

There is a project synrc/fs which provides filesystem change events. This supports Mac, Windows and Linux platforms.

This commit integrates sync with fs. Here is what it does:

1. Added a new app evnironment variable, sync_method. User can specifiy this to scanner or fsevents. By default it will be scanner, which would retain current behavior. If user specifies fsevents, new logic kicks in.
2. discover_src_dirs, will discover all source directories as requested by user. and starts fs process for monited directories.
3. When a source file or a header file changes, sync gets {fs,file_event} event. And it will handle the changed files a second later so that it can suppress/collect all events on a file.
4. Make sure no timers are active in stable state.

Signed-off-by: Vasu Dasari <[email protected]>
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

No branches or pull requests

1 participant