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

Add FileSystemWatcher support #9

Merged
merged 14 commits into from
Dec 5, 2017
Merged

Add FileSystemWatcher support #9

merged 14 commits into from
Dec 5, 2017

Conversation

Rohansi
Copy link
Contributor

@Rohansi Rohansi commented Dec 3, 2017

Current progress so far, not quite ready to merge. Still needs some documentation and unit tests.

Copy link
Owner

@xoofx xoofx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Will give a more insightful look later tonight.

@@ -7,6 +7,7 @@
using System.IO;
using System.Linq;
using Zio.FileSystems;
using Zio.Watcher;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to avoid a new namespace actually and the dependencies that it brings (Zio -> Zio.Watcher, Zio.FileSystems -> Zio.Watcher...etc.)
Could you move:

  • the watcher interfaces (and related events) to the top root namespace along the IFileSystem.
  • the helper implementations (aggregate, wrap) to FileSystems

@Rohansi
Copy link
Contributor Author

Rohansi commented Dec 5, 2017

Okay, I fixed all my issues with it.

_globalLock = new FileSystemNodeReadWriteLock();
_dispatcher = new FileSystemEventDispatcher<Watcher>();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we delay the creation of a _dispatcher only if we are actually using the watch API? I would prefer if we could avoid the cost of having a thread created...etc.

@Rohansi
Copy link
Contributor Author

Rohansi commented Dec 5, 2017

Were there any other issues with this?

@xoofx xoofx merged commit 6b191b8 into xoofx:master Dec 5, 2017
@xoofx
Copy link
Owner

xoofx commented Dec 5, 2017

That's all good, sorry I'm on a business trip so a bit less available this week. Will take a bit more time next week to check things more deeply and package a new version, thanks for this PR!

@xoofx xoofx mentioned this pull request Dec 9, 2017
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