tokio-process-stream
tokio-process-stream is a simple crate that wraps a tokio::process into a
tokio::stream
Having a stream interface to processes is useful when we have multiple sources of data that we want to merge and start processing from a single entry point.
This crate provides a futures::stream::Stream wrapper for tokio::process::Child. The
main struct is ProcessLineStream, which implements the trait, yielding one Item enum
at a time, each containing one line from either stdout (Item::Stdout) or stderr
(Item::Stderr) of the underlying process until it exits. At this point, the stream
yields a single Item::Done and finishes.
Example usage:
use ProcessLineStream;
use Command;
use StreamExt;
use Error;
async
Streaming chunks
It is also possible to stream Item<Bytes> chunks with ProcessChunkStream.
use ;
use Command;
use StreamExt;
use Error;
async