This is more for running external commands than running internal code. Took me a while to figure that out. I'm looking at the notify crate now for watching the system and running code that way.
I wasn't able to use CTRL+c to stop a running app until I added the Signal::Interrupt check. I had to use `ps`` to find the pocess ID and then use `kill -9 PID`` to stop it. Turned out to not be a big deal but I would have preferred to know that going in
TODO: clean up and put this version in place for this post
TODO: Look at the neo process for a solution to only running one process at a time (assuming you solve for that)
TODO: Remove this prior version of the code when the new version is polished
This is what I'm doing to automatically run my site built process when content files change.
The `.action_throttle()`rust` value of 100000000 is nanoseconds and translates to 0.1 seconds for debouncing. I thought the method was broken at first becuase I was using a value based on milliseconds which made it seem like there was no delay at all.
I've got a dedupe in place to try to work alongside the debounce throttle, but it's not working yet
The `.action_throttle()`rust` is there in an effort to debounce but it's not doing what I want. Needs more investigation.
There are often several file events that fire for one file change. I'm pushing all the paths for any batch into a vec then deduping it as a partial measure to debounce
You can use CTRLc to stop the process
Using the struct that's outside of the `.on_action()`rust` requires keeping it outside of the `async`rust` call. It took a while to figure that part out. It seems like there should be a way to get it in there, but this is fine for my purpose because the build files should probably go synchronously anyway.
Link over to the other piece that points to just catching Control-C.
Refine this post as an alternative and then cross link it with this one: 2p1t9jxc5gmb