send_ctrlc
A cross platform crate for interrupting or terminating child processes
Install
cargo add send_ctrlc
# Or for async/tokio:
cargo add send_ctrlc -F tokio
Features
- Cross platform (including Windows)
- Uniform cross platform API
- Both sync and async
- Only 2 unsafe calls
- Minimal dependencies:
- Synchronous:
libcon unix, andwindows-syson windows - Asynchronous:
tokio(with onlyprocessfeature)
- Synchronous:
Examples
The first example below is for synchronous use cases and the second for tokio/async use cases. However, both
interruptandterminateare available for both sync/async code.
use ;
// Interrupt example
// Terminate example (async/tokio)
async
Contributions
Contributions are welcome as long they align with the vision for this crate.