1.6 KiB
FileMonitor
This was a Rust Challenge that I completed in 17 hours.
Review
I thought I solved the challenge pretty well. I took my time and went back and refactored and commented well.
Notify was a crate I hadn't used before so that took some time to understand and then determine how I wanted to wrap it up. I like the solution that I came up with because it keeps most of the notify mess contained in one file with just a little seepage out when it has to be used for monitoring.
One thing I was not happy about was that I had very poor git commiting during the challenge. I think it was because I was trying to keep my time lower, but would it really have hurt to spend a little bit of time to commit and give myself better backups incase of a big problem? Probably not.
This let me work on and understand rust async. I had read the rust book and the tokio tutorial completely before doing this challenge. It wasn't that bad. It reminds me of coding for threads a lot, which is good, but sometimes the await gets me because I don't understand where it is blocked when it is running sometimes, tokio-console helps here, and why calls block or what they are blocking for. For example, why does tokio::io::stdout().write_all() seem to block forever? It is given a few bytes to write to out, it should be able to dump those to the console quickly enough.
Really, i think my problem with the async IO calls was that they needed to happen in a seperate task and be listening for messages on what to print. That way they are never able to block a different task.
Next I think I should checkout the rayon crate, but we'll see what the next challenge I get is.