fallow_process/lib.rs
1//! Shared subprocess lifecycle management for Fallow.
2//!
3//! Protocol adapters and analysis facades use the same registered child
4//! handles and operating-system process-tree primitives. This keeps timeout
5//! cleanup and signal cleanup identical without introducing dependencies on
6//! the CLI crate.
7//!
8//! The optional `tokio` feature adds async command setup and bounded cleanup
9//! while preserving the same operating-system tree owner.
10
11mod process_tree;
12mod registry;
13mod scoped_child;
14mod spawn_retry;
15
16pub use process_tree::{ChildCleanup, ProcessTree, cleanup_std_child, configure_std_command};
17#[cfg(feature = "tokio")]
18pub use process_tree::{cleanup_tokio_child, configure_tokio_command};
19pub use scoped_child::{ProcessTreeTerminator, ScopedChild, output, status};
20pub use spawn_retry::spawn_retrying_busy_executable;
21#[cfg(feature = "tokio")]
22pub use spawn_retry::spawn_tokio_retrying_busy_executable;
23
24/// Terminate every registered child or process tree and wait for bounded
25/// cleanup.
26pub fn drain_and_kill() {
27 registry::drain_and_kill();
28}