hi, i opened a subprocess using

transport, proto = yield from loop.subprocess_exec(SubprocessProtocol, *mycmd)

now, how do i write something to stdin asynchronously, and then react to 
lines being written? basically:

stdin = transport.get_pipe_transport(0)
stdin.write(msg)  # this is backgrounded… coroutine version?
stdin.close()  # and/or stdin.write_eof()

reader = SomeKindOfReader(self.transport.get_pipe_transport(1))
while reader.can_read():  # not EOF or connection closed
    response = yield from reader.readline()  # should return when EOF or conn. 
closed
    do_sth_with(response)

Reply via email to