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

Issue 89: Adding new sync_method - fsevents #90

Merged
merged 1 commit into from
Nov 15, 2020

Conversation

vasu-dasari
Copy link
Contributor

Issue has been detailed at: #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]

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]>
@choptastic
Copy link
Collaborator

choptastic commented Jul 16, 2020 via email

@vasu-dasari
Copy link
Contributor Author

Thanks

@choptastic choptastic merged commit 3969698 into rustyio:master Nov 15, 2020
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.

2 participants