Commit Graph

656 Commits

Author SHA1 Message Date
Félix Saparelli
8e4994abca
Add process supervisor to watch command to completion
Also change the concept of a completion handler to instead sending a
synthetic "process completed" event down the same path as usual.

That makes handling completion the job of the action handler, but also
means it's immediately possible to launch a process or do an action in
response to the process completing. Win win!
2021-09-03 05:22:15 +12:00
Félix Saparelli
0f247e9e5c
Fix demo for poll option gaining a timeout 2021-09-03 05:18:30 +12:00
Félix Saparelli
ef453193af
Add pre-spawn and post-spawn hooks 2021-08-25 04:41:14 +12:00
Félix Saparelli
1fd5c85317 Good idea but let's keep compat for now 2021-08-25 02:40:22 +12:00
Félix Saparelli
6df6d6fd5a Handle signals in cli 2021-08-24 23:19:44 +12:00
Félix Saparelli
7d492fa677
Hide --watch-when-idle from help 2021-08-24 22:56:15 +12:00
Félix Saparelli
70e8a4dff2
Fix cli tests 2021-08-24 22:53:44 +12:00
Félix Saparelli
58b37940b8 Implement most existing options and mark the rest 2021-08-24 22:46:16 +12:00
Félix Saparelli
6767948daa
Specify delay for fs Poll mode 2021-08-24 22:28:29 +12:00
Félix Saparelli
33fb691d29
Add method to insert events into watchexec manually 2021-08-24 22:20:44 +12:00
Félix Saparelli
9cb1f5bf79
Re-export Outcome's Signal type 2021-08-24 21:31:46 +12:00
Félix Saparelli
e939f97c90
Move config creation out of arg parsing, and start on using libv2 2021-08-24 20:23:37 +12:00
Félix Saparelli
23d794ed7e
Apply tabs project-wide 2021-08-24 20:22:25 +12:00
Félix Saparelli
33f8b60e46
Take IntoIterator<AsRef<str>> to be more flexible on input 2021-08-24 20:14:01 +12:00
Félix Saparelli
05afb141b6
Add InitConfig::builder() to be a little more idiomatic
Neat side effect: keeps rust-analyzer from complaining about unknown types
(because it doesn't expand the builder macro)!
2021-08-24 19:59:11 +12:00
Félix Saparelli
b4ead7f5fb
Report several runtime errors if notify gives us several paths in an error 2021-08-23 06:08:25 +12:00
Félix Saparelli
3588cb4d62
Log fs watch/unwatch errors harder (to reveal paths) 2021-08-23 05:15:55 +12:00
Félix Saparelli
6cb3fc1c9a
Demo switching file watcher backends at runtime 2021-08-23 03:59:02 +12:00
Félix Saparelli
4a9168f5e6
Log on graceful exit 2021-08-23 03:36:10 +12:00
Félix Saparelli
9b94f18890
Fix double-actioning in throttle 2021-08-23 03:12:23 +12:00
Félix Saparelli
b42336cb74
Actually watch files in example 2021-08-23 03:11:58 +12:00
Félix Saparelli
b2effda341
Update to miette 1.0 beta 2021-08-23 02:37:13 +12:00
Félix Saparelli
5314d201a4
Expand print_out example into watchexec test case 2021-08-23 02:36:58 +12:00
Félix Saparelli
74d8e73817
Fix tokio panic for async handlers 2021-08-23 02:35:28 +12:00
Félix Saparelli
931648a955
Add signals() convenience iter on Event 2021-08-23 02:35:03 +12:00
Félix Saparelli
cc5b1c988e
Add some logging to Process 2021-08-23 02:34:44 +12:00
Félix Saparelli
60ed6bba25
Fix infinite loop in action recv code 2021-08-23 02:34:29 +12:00
Félix Saparelli
05117e69fe
Prep for more handlers in action 2021-08-23 02:33:23 +12:00
Félix Saparelli
4843920a36
Protect again starting command without anything in command 2021-08-23 02:32:48 +12:00
Félix Saparelli
17b09d8798
Add graceful exit support 2021-08-23 02:32:08 +12:00
Félix Saparelli
f4a8a9fc6a
Print PID in initialisation 2021-08-23 02:30:56 +12:00
Félix Saparelli
18d2487ec3
Rename reconfig to reconfigure 2021-08-23 00:31:39 +12:00
Félix Saparelli
3066ee5913
Implement most of process handling 2021-08-23 00:28:20 +12:00
Félix Saparelli
f150c26b22
Add action.grouped config 2021-08-23 00:27:45 +12:00
Félix Saparelli
d2d0bb7be2
Resolve compound outcomes 2021-08-22 23:23:01 +12:00
Félix Saparelli
7a709b9b4d
Prefer generic Both combinator than specific ClearAnd 2021-08-22 23:22:27 +12:00
Félix Saparelli
c85c164c09
Make the example in lib.rs compile 2021-08-22 22:06:50 +12:00
Félix Saparelli
227c2a0e0d
Add command and shell options to action 2021-08-22 22:06:31 +12:00
Félix Saparelli
613fe24c64
Add paths() convenience iter on Event 2021-08-22 22:06:12 +12:00
Félix Saparelli
8998c40746
Add convenience methods for Outcome's combinators 2021-08-22 22:05:45 +12:00
Félix Saparelli
d7d549a4c8
Add convenience modifiers on RuntimeConfig ourselves
It's not exactly a builder, and this lets us flatten all the options at the
top level instead of requiring the user to dig deeper into the
action, fs, etc modules' WorkingData structs.
2021-08-22 22:05:09 +12:00
Félix Saparelli
6c3c06e39c
Stop using Builder for RuntimeConfig 2021-08-22 20:49:24 +12:00
Félix Saparelli
53854d93d4
Change Outcome::OrStart to the more flexible ::IfRunning 2021-08-22 20:47:47 +12:00
Félix Saparelli
656c0d8fd2
Fix action throttling
Specifically, on loop start the timeout would be for the full throttle duration,
which is not correct if some time has passed or the loop goes on recycle
2021-08-22 20:29:57 +12:00
Félix Saparelli
40f6f7397f
Fill out Outcome 2021-08-22 20:27:51 +12:00
Félix Saparelli
5b8611a8c0
Make notes on needed docs 2021-08-22 20:26:48 +12:00
Félix Saparelli
350b85e0c7
Allow an outcome to be determined by the action handler without &mut! 2021-08-22 18:56:57 +12:00
Félix Saparelli
2a0661b122
Call action handler on action 2021-08-22 05:58:03 +12:00
Félix Saparelli
2812a723ff
Write action throttling code 2021-08-22 02:54:02 +12:00
Félix Saparelli
ce60be2ec9
Add print_out example 2021-08-22 02:53:31 +12:00