simple inter-process communication simple inter-process communication python python

simple inter-process communication


It turns out that interprocess communication is, while on the surface straightforward, actually fraught with complications. Whatever anyone tells you here in terms of a simplified answer, always keep in mind that there is probably a lot of caveats that are being left unsaid.

Now with that disclaimer out of the way, I claim that what you likely want are message queues. This is based on the fact that you did not include an ip address in your example api. If you need to go across machines, you will want sockets. However, I think you will find message queues to be simpler to understand if you can deal with the fact that this is only for communicating with processes on the same machine.

A good starting point for perl is:
http://perldoc.perl.org/IPC/Msg.html

for python, this seems to explain (ignore the other kinds of ipc like semaphores):
http://semanchuk.com/philip/sysv_ipc/


And for powered-up communications in the same style as socket, consider looking at 0MQ. It can make use of different communication technologies depending where your two apps are located, and even for local processes it's very easy to use and solves the problems for you.

http://zeromq.org


In general you are interested in sockets. A good place to get just the needed rough information is the documentation of IO::Socket::INET or more basic socket-stuff in perl from perldoc perlipc