Skip to main content

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;
14
15pub use process_tree::{ChildCleanup, ProcessTree, cleanup_std_child, configure_std_command};
16#[cfg(feature = "tokio")]
17pub use process_tree::{cleanup_tokio_child, configure_tokio_command};
18pub use scoped_child::{ProcessTreeTerminator, ScopedChild, output, status};
19
20/// Terminate every registered child or process tree and wait for bounded
21/// cleanup.
22pub fn drain_and_kill() {
23    registry::drain_and_kill();
24}