Docs: watchexec

This commit is contained in:
Félix Saparelli 2021-10-17 03:01:55 +13:00
parent fae4fbf9a0
commit 60fa09182d
No known key found for this signature in database
GPG Key ID: B948C4BAE44FC474
1 changed files with 9 additions and 1 deletions

View File

@ -24,6 +24,13 @@ use crate::{
signal,
};
/// The main watchexec runtime.
///
/// All this really does is tie the pieces together in one convenient interface.
///
/// It creates the correct channels, spawns every available event sources, the action worker, the
/// error hook, and provides an interface to change the runtime configuration during the runtime,
/// inject synthetic events, and wait for graceful shutdown.
pub struct Watchexec {
handle: Arc<AtomicTake<JoinHandle<Result<(), CriticalError>>>>,
start_lock: Arc<Notify>,
@ -41,7 +48,7 @@ impl fmt::Debug for Watchexec {
}
impl Watchexec {
/// TODO
/// Instantiates a new `Watchexec` runtime from configuration.
///
/// Returns an [`Arc`] for convenience; use [`try_unwrap`][Arc::try_unwrap()] to get the value
/// directly if needed.
@ -117,6 +124,7 @@ impl Watchexec {
}))
}
/// Applies a new [`RuntimeConfig`] to the runtime.
pub fn reconfigure(&self, config: RuntimeConfig) -> Result<(), ReconfigError> {
debug!(?config, "reconfiguring");
self.action_watch.send(config.action)?;