[Twisted-Python] More general process.Process class

Hi, I'm currently fiddling with spawnProcess() and such, trying to stream it's output to somewhere else. In a first attempt, I've tried to cache the data in the ProcessProtocol's outReceived() call. Then, I've realized, that twisted already has quite nice abstractions of Producers and Consumers. I would like to use them, as they seem to fit nicely. And in my case, it would even make much sense to *not* read all the data from the process, but leave it there, waiting on the file descriptor, until I'm ready to process the data. Unfortunately, AFAICT the producers attached to the process - namely the ProcessReader() instances created by process.Process - are hard wired to the ProcessProtocol's dataReceived() method. While I would like to use these producers directly, instead of providing such a ProcessProtocol. I'm thinking about ripping out the protocol handling from the process.Process class. Instead let process.Process return a list of producers and consumers in self.pipes, as requested. Then let another wrapper class bridge between those and the ProcessProtocol. Comments? Regards Markus

On Wed, 04 Jul 2007 16:13:14 +0200, Markus Schiltknecht <markus@bluegap.ch> wrote:
Do you need more granularity than Process.pauseProducing/resumeProducing provide? Aside from that, purely as a point of procedure, any changes you make to Process at the moment are likely to conflict with a development branch which is currently outstanding. You might want to look at that or help get it merged before starting on any changes of your own. Jean-Paul

Hi, Jean-Paul Calderone wrote:
Do you need more granularity than Process.pauseProducing/resumeProducing provide?
Hm.. you're right, those could probably do the trick.
Uh... there are 153 branches in the repository... which one are you talking about?
You might want to look at that or help get it merged before starting on any changes of your own.
Sure, thanks! Markus

On Wed, 04 Jul 2007 16:42:50 +0200, Markus Schiltknecht <markus@bluegap.ch> wrote:
http://twistedmatrix.com/trac/ticket/2341 / /branches/merge-process-and-ptyprocess-2341-2

On Wed, 04 Jul 2007 16:13:14 +0200, Markus Schiltknecht <markus@bluegap.ch> wrote:
Do you need more granularity than Process.pauseProducing/resumeProducing provide? Aside from that, purely as a point of procedure, any changes you make to Process at the moment are likely to conflict with a development branch which is currently outstanding. You might want to look at that or help get it merged before starting on any changes of your own. Jean-Paul

Hi, Jean-Paul Calderone wrote:
Do you need more granularity than Process.pauseProducing/resumeProducing provide?
Hm.. you're right, those could probably do the trick.
Uh... there are 153 branches in the repository... which one are you talking about?
You might want to look at that or help get it merged before starting on any changes of your own.
Sure, thanks! Markus

On Wed, 04 Jul 2007 16:42:50 +0200, Markus Schiltknecht <markus@bluegap.ch> wrote:
http://twistedmatrix.com/trac/ticket/2341 / /branches/merge-process-and-ptyprocess-2341-2
participants (2)
-
Jean-Paul Calderone
-
Markus Schiltknecht