On 5 September 2014 13:13, <exar...@twistedmatrix.com> wrote: > On 06:30 am, a...@roiban.ro wrote: [snip] >> For a new design: >> >> * I like the ProcessProtocol API > > > I don't. :) ProcessProtocol means you can't re-use any of your existing > IProtocol implementations. Oops. > > It seems like a better API would let you say "Here is a protocol, hook its > output up to fd 0 in the process, hook fd 1 in the process up to its input. > Here is another protocol, hook fd 2 in the process up to its input" (this > would probably be a common configuration - "speak some regular protocol over > stdin/stdout, have a little special logic (probably logging) for stderr). > > On the other hand, it's possible to build this on top of ProcessProtocol and > no one ever has...
I lied about ProcessProtocol API... I don't like the current API as it is ... but I like the idea of a single protocol. Maybe is not that hard to convert IProcessProtocol into IProtocol. create makeConnection, rename outRecevied to dataReceived, rename processEnded to connectionLost... rename errReceived to errorReceived I assume that most executables will implement a single protocol and adding another IProtocol to handle stderror seems complicated. I assume that the stderr protocol will want to share a lot of state/data with the stdout/stdin protocol. [snip] >> ----- >> >> Does it make sense to put it on wiki or what should be the Twisted >> Enhancement Proposal process? > > > I think it's easier to maintain a document on the wiki than in threads on > the mailing list. >> >> Can I get 'create page' rights on Trac? > > > Hm. I thought everyone had wiki edit rights (except for a small number of > privileged pages) by default - so I'm not sure what's going on here or how > to give you permissions. Perhaps something changed in the trac upgrade or > as part of the recent ticket permission reconfiguration. My bad... I tried trac/spawnProcess instead of trac/wiki/spawnProcess and I did not read the error message and assume that somehow I don't have WIKI_CREATE permissions. Here it is: https://twistedmatrix.com/trac/wiki/spawnProcess-refactoring -- Adi Roiban _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python