Subterm
A Rust library for efficiently managing pools of interactive subprocesses with async support.
Features
- Efficient Process Pool Management: Maintain a pool of reusable subprocess instances
- Async/Await Support: Built on tokio for asynchronous operation
- Fair Queue Management: Uses a channel-based queuing system for fair process allocation
- Interactive Process Control: Read from and write to subprocess stdin/stdout
- Automatic Process Recovery: Dead processes are automatically replaced
- Resource Control: Limit the maximum number of concurrent processes
Usage
Add this to your Cargo.toml:
[]
= "0.0.1"
Using the Process Pool
use ;
use Command;
async
Direct Subprocess Usage
You can also create and manage subprocesses directly without using the pool:
use Arc;
use ;
use Command;
async
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contributing
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.