parent
adc4a0a576
commit
92d05755c9
|
@ -31,6 +31,7 @@ First "stable" release of the library.
|
|||
- Improvement: the event queue is explicitly closed when shutting down
|
||||
- Improvement: the action worker will check if the event queue is closed more often, to shutdown early
|
||||
- Improvement: `kill_on_drop` is set on Commands, which will be a little more eager to terminate processes when we're done with them
|
||||
- Feature: `Outcome::Sleep` waits for a given duration ([#79](https://github.com/watchexec/watchexec/issues/79))
|
||||
|
||||
Other miscellaneous:
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
use std::time::Duration;
|
||||
|
||||
use crate::signal::process::SubSignal;
|
||||
|
||||
/// The outcome to execute when an action is triggered.
|
||||
|
@ -26,6 +28,9 @@ pub enum Outcome {
|
|||
/// Does nothing if the command isn't running.
|
||||
Wait,
|
||||
|
||||
/// Sleep for some duration.
|
||||
Sleep(Duration),
|
||||
|
||||
/// Send this signal to the command.
|
||||
///
|
||||
/// This does not wait for the command to complete.
|
||||
|
|
|
@ -9,6 +9,7 @@ use futures::Future;
|
|||
use tokio::{
|
||||
spawn,
|
||||
sync::{mpsc, watch::Receiver},
|
||||
time::sleep,
|
||||
};
|
||||
use tracing::{debug, error, trace, warn};
|
||||
|
||||
|
@ -153,6 +154,10 @@ impl OutcomeWorker {
|
|||
notry!(self.process.wait())?;
|
||||
}
|
||||
|
||||
(_, Outcome::Sleep(time)) => {
|
||||
notry!(sleep(time));
|
||||
}
|
||||
|
||||
(_, Outcome::Clear) => {
|
||||
clearscreen::clear()?;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue