2014/1/24 Gustavo Carneiro <[email protected]>:
> IMHO, loop.subprocess_exec should take up to 3 protocol factories, not just
> one, for this precise reason.  As it is now, this API is really ugly IMHO.

I don't think that everything should be changed. The minimum is to
allow to specify a protocol for write pipe and another for read pipe.

For example, the following code of BaseSubprocessTransport._post_init():
    transp, proto = yield from loop.connect_write_pipe(
        lambda: WriteSubprocessPipeProto(self, STDIN),
        proc.stdin)
should be replaced with something like:
    transp, proto = yield from self.connect_write_pipe(STDIN, proc.stdin)

So a child class can easily override this method to build its own protocol.

Victor

Reply via email to