Good cross-host IPC?

Kirk Strauser kirk at daycos.com
Mon Jun 16 15:39:28 EDT 2008


We've been using NetWorkSpaces
(http://www.ddj.com/web-development/200001971) for IPC on programs running
on several different machines.  Since it uses a central, shared server for
storing values, you don't have to write socket code in your various programs
to pass data back and forth.

For example, a program can request some work to be done by a random machine
on the network like so:

>>> from nws.client import NetWorkSpace
>>> space = NetWorkSpace('test')
>>> space.store('value', 42)
>>> ws.fetch('results')
43

...and a worker process can listen for work to do and return the results by
doing:

>>> from nws.client import NetWorkSpace
>>> space = NetWorkSpace('test')
>>> value = space.fetch('value')
>>> space.store('results', value + 1)

Since space.fetch() is a blocking call and the NetWorkSpaces server answers
requests in the order that they're received, this is a nice way to
coordinate a cluster.

This is pretty spiffy and works great in practice, but it feels like we're
the only people using it.  Parallel Python lives in kind of the same problem
space, but not all of our code is easily bent to its will.  Is there
another, more common way of doing this stuff?

Popularity isn't the most important thing in the world, but I like the warm
fuzzies of knowing that thousands of others are testing and using the same
project as we are.
-- 
Kirk Strauser
The Day Companies



More information about the Python-list mailing list