Need some IPC pointers

Lie Ryan lie.1296 at gmail.com
Thu Dec 8 11:21:52 EST 2011


On 12/01/2011 08:03 AM, Andrew Berg wrote:
> I've done some research, but I'm not sure what's most appropriate for my
> situation. What I want to do is have a long running process that spawns
> processes (that aren't necessarily written in Python) and communicates
> with them. The children can be spawned at any time and communicate at
> any time. Being able to communicate with non-local processes would be
> nice, but is not necessary. The implementation needs to be
> cross-platform, but child processes will use the same OS as the parent
> during runtime.
> I don't think I'll ever need to transfer anything complicated or large -
> just strings or possibly tuples/lists. I'd rather not go outside the
> standard library (but I'd consider it). I don't need to worry about
> compatibility with older Python versions; if it only works with Python
> 3.2, that's not a problem.
> I'm thinking sockets, but perhaps there's something simpler/easier.
>

Considering your requirements, I'd suggest a RESTful web service. It is 
fairly trivial to write HTTP clients in most languages, and python's 
standard library comes with a simple HTTP server so writing the server 
is easy as well.

In context, the "long running process" will be the "server", the 
"children processes" will be the "client". Writing HTTP client is fairly 
trivial in most languages, the protocol is platform independent, and it 
is fairly trivial to communicate with non-local processes over the LAN 
or the Internet. As a plus, it's well standardized.

As the data interchange format, I suggest either xml or json. There is a 
library for xml and json in almost any popular languages. Python comes 
with both.




More information about the Python-list mailing list