Skip to main content

spawn_pipe_reader

Function spawn_pipe_reader 

Source
pub fn spawn_pipe_reader(child: &mut Child) -> JoinHandle<Vec<u8>>
Expand description

Takes the child’s stderr pipe and drains it on a background thread.

A child whose stderr is piped but never read blocks once the pipe buffer fills, which turns a noisy git log into a hang. Join the handle after the child exits to get everything it wrote.