ej_io/lib.rs
1//! Process execution and I/O management for the EJ framework.
2//!
3//! Provides utilities for spawning, monitoring, and controlling external processes
4//! with real-time output capture and timeout handling.
5//!
6//! # Usage
7//!
8//! ```rust
9//! use ej_io::runner::{Runner, RunEvent};
10//! use std::sync::{Arc, atomic::AtomicBool, mpsc};
11//!
12//! // Create a process runner
13//! let runner = Runner::new("echo", vec!["Hello, World!"]);
14//! let (tx, rx) = mpsc::channel();
15//! let should_stop = Arc::new(AtomicBool::new(false));
16//!
17//! // Run the process with event handling
18//! let exit_status = runner.run(tx, should_stop);
19//!
20//! // Handle events
21//! while let Ok(event) = rx.try_recv() {
22//! match event {
23//! RunEvent::ProcessNewOutputLine(line) => println!("Output: {}", line),
24//! RunEvent::ProcessEnd(success) => println!("Process ended: {}", success),
25//! _ => {}
26//! }
27//! }
28//! ```
29
30pub mod process;
31pub mod runner;