fn thread_fn(pipe: Arc<Mutex<Pipe>>, child: Arc<Mutex<ChildProcess>>) -> Result<Vec<(Instant, String)>, UECOError> {
        let pipe = pipe.lock().unwrap();
        let mut lines_by_timestamp = vec![];

        let mut eof;
        loop {
            let line = pipe.read_line()?;
            match line {
                None => { eof = true }
                Some((instant, line)) => {
                    eof = false;
                    lines_by_timestamp.push((instant, line))
                }
            }

            let process_is_running = child.lock().unwrap().check_state_nbl() == ProcessState::Running;
            let process_finished = !process_is_running;
            if process_finished && eof {
                trace!("Child finished & read EOF");
                break;
            }
        }

        Ok(lines_by_timestamp)
    }
/// Thread function that reads all lines either for STDERR or STDOUT. There will be two
/// thread instances of this, if this strategy is choosen.
Thread function that reads all lines either for STDERR or STDOUT. There will be two
thread instances of this, if this strategy is choosen.
Thread function that reads all lines either for STDERR or STDOUT . There will be two thread instances of this if this strategy is choosen .
fn thread_fn(pipe: Arc<Mutex<Pipe>>, child: Arc<Mutex<ChildProcess>>) -> Result<Vec<(Instant, String)>, UECOError> {
        let pipe = pipe.lock().unwrap();
        let mut lines_by_timestamp = vec![];
        let mut eof;
        loop {
            let line = pipe.read_line()?;
            match line {
                None => { eof = true }
                Some((instant, line)) => {
                    eof = false;
                    lines_by_timestamp.push((instant, line))
                }
            }
            let process_is_running = child.lock().unwrap().check_state_nbl() == ProcessState::Running;
            let process_finished = !process_is_running;
            if process_finished && eof {
                trace!("Child finished & read EOF");
                break;
            }
        }
        Ok(lines_by_timestamp)
    }
fn thread_fn ( pipe : Arc < Mutex < Pipe > > , child : Arc < Mutex < ChildProcess > > ) -> Result < Vec < ( Instant , String ) > , UECOError > { let pipe = pipe . lock ( ) . unwrap ( ) ; let mut lines_by_timestamp = vec ! [ ] ; let mut eof ; loop { let line = pipe . read_line ( ) ? ; match line { None => { eof = true } Some ( ( instant , line ) ) => { eof = false ; lines_by_timestamp . push ( ( instant , line ) ) } } let process_is_running = child . lock ( ) . unwrap ( ) . check_state_nbl ( ) == ProcessState :: Running ; let process_finished = ! process_is_running ; if process_finished && eof { trace ! ( " " ) ; break ; } } Ok ( lines_by_timestamp ) }
Thread function that reads all lines either for STDERR or STDOUT.
Thread function that reads all lines either for STDERR or STDOUT .
pipe
Arc<Mutex<Pipe>>
child
Arc<Mutex<ChildProcess>>