code: def _reader_thread_proc(self, timeout):
      
      for data in self.stream.read_until_close(timeout_ms=timeout):
        if self.stdout is not None:
          self.stdout.write(data)
docs: Read until the stream is closed.