Crate xstream_util

Source
Expand description

xstream library

Provides [xstream] to take a BufRead and splits it as input among several processes. There’s current not any async support, and therefore no real way to interact with the processes afterwards. Even collecting the output would require effort / synchronization, so currently they’re all just piped to the standard inhereted buffers.

§Usage

use std::process::Command;
use xstream_util::Limiting;

let mut input = // ...
// Spawn up to two `cat` processes, could also use `Rotating`
let mut pool = Limiting::new(Command::new("cat"), 2);
xstream_util::xstream(&mut pool, &mut input, &b"\n", &None::<&[u8]>).unwrap();

Structs§

Limiting
A pool to manage spawning a limited number of processses
Rotating
A pool to manage spawning a limited number of processses

Enums§

Error
An error raised by xstream

Traits§

Pool
A type that can get child processes on demand

Functions§

xstream
Stream one reader into several independent processes