-
Notifications
You must be signed in to change notification settings - Fork 235
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
windows implementation #4
Comments
Useful to know, thanks. I don't have a windows dev box, so this is improbable to happen for a while unless someone wants to work on it. |
🐰 |
Okay, implementing this is a bit more complex than I thought. I'm getting into a big pile of concurrency, and just handling all the possible error cases is a confusing mire. |
@retep998 If you don't mind waiting a bit I've got an implementation I've been working on, but I don't think I'll be able to get a PR up until probably this weekend. |
@maurizi I'll wait for you to create your PR before I make a PR then. |
An update on this, I have a work-in-progress branch: maurizi@f24f3fe. I'm still trying to sort out a few issues. I'm trying to pass a completion routine to @retep998 Any advice on this? Some googling has indicated that using an I/O completion port might be a better plan, but I don't really know. |
@maurizi Completion routines are only called during alertable sleep. Therefore you need to use one of the |
@maurizi I don't know if this is of any help to you, but perhaps take a look at how other packages from other languages have tackled this. As well as general advice on Just trying to help! I really want you to succeed with this :) |
Hi folks, I managed to get @maurizi 's branch working. I used a variant of @retep998 's request and use SleepEx to allow the completion callbacks to fire. I use select! to check a timeout channel on the action loop so that I don't block forever there. With these changes it works for me, but I still need to do some cleanup. Also I'm a bit worried about using select! since the compiler gave me a really scary warning about its instability. Any other feedback is appreciated, I'm still pretty new at Rust coding. |
@jmquigs That's awesome! 💯 When it's ready, do submit a PR, and I'll try to get a Windows box set up so I can compile it. |
@passcod I'm in the process of cleaning it up now. I was trying to get the unit tests working, and noticed that fsevent panics when it can't send a notify event, while inotify and poll appear to ignore that error. What are the required semantics here? Ignore would be better for windows. When the "validate_watch_dir" test exits, the watcher is dropped and it appears that the channel is also closed, but a final event is being processed for file deletion (also from drop), and the send fails for that event. |
Ignore is good :) |
Cool. I also wanted to ask about the single file test: Its a little funky, in that it appears to create the file before the watcher is watching it. ReadDirectoryChangesW misses it because of that; it only a gets Create event for files created after it is started. To make windows pass, I'd need to modify the test so that it starts the watcher first, and then check something other than create. Or I could create a new test. Do you have a preference? In general windows has the limitation that the watched path must actually exist, because I need to handle files and directories differently, so I need to know whether its a file/dir up front. |
Create a new test :) |
Ok, I believe I did that in the PR. |
I know you already have this in your todo list, but I thought I would bring it to your attention that someone has provided the signatures for what I believe to be the necessary types and functions here, in case you ever get around to this.
The text was updated successfully, but these errors were encountered: