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

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. Thanks, Ryan

On Tue, Oct 6, 2009 at 11:18 PM, Ryan Burns <rburns@stic.net> wrote:
Disregarding reasons of why I would want to do this, is this something that is possible?
Absolutely. Here's an example that uses AMP rather than PB: https://launchpad.net/ampoule If AMP is OK, you can just use Ampoule as-is; if not, you can replace the AMP protocol classes it uses with the appropriate PB analogs.

wow, ampoule looks like just what I need, and I think it will work fine as-is. Thanks for the help, Ryan On Oct 6, 2009, at 8:56 PM, Glyph Lefkowitz wrote:
On Tue, Oct 6, 2009 at 11:18 PM, Ryan Burns <rburns@stic.net> wrote:
Disregarding reasons of why I would want to do this, is this something that is possible?
Absolutely. Here's an example that uses AMP rather than PB:
If AMP is OK, you can just use Ampoule as-is; if not, you can replace the AMP protocol classes it uses with the appropriate PB analogs.
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
participants (2)
-
Glyph Lefkowitz
-
Ryan Burns