[Twisted-Python] using perspective broker to talk to a subprocess?

Ryan Burns rburns at stic.net
Tue Oct 6 23:18:27 EDT 2009

Hi All,

I'm writing a twisted application where I'd like to run and  
communicate with subprocesses that also happen to be twisted apps. I'm  
wondering if I can somehow combine twisted's process and perspective  
broker code so that I can launch a twisted server in a subprocess and  
communicate with it via the perspective broker using the subprocess's  
stdin/stdout. Ideally, it would be great if this could scale, say up  
to 200 subprocesses.

Disregarding reasons of why I would want to do this, is this something  
that is possible? I've looked at the perspective broker classes and  
the processProtocol as well as some of the helpers, but I don't quite  
see how to make it happen. Should I just use a socket instead and  
handle managing unique names/ports per subprocess on my own? Or any  
alternative ideas? Ultimately I just want to run subprocesses from my  
twisted app and communicate with them without having to do a bunch of  
parsing on my own and the subprocesses will be twisted as well, so I  
figure why not make use of twisted for my IPC.


More information about the Twisted-Python mailing list