networking with pyro

Tim Golden tim.golden at tesco.net
Thu Jun 24 22:02:28 CEST 2004


> I'm working on a distributed application using Pyro, and I've come
> across several issues I'm not really sure how to handle, since this is
> my first distributed application.

It's worth posting to the Pyro mailing list as
well, if you haven't already.
http://lists.sourceforge.net/lists/listinfo/pyro-core

> My application consists of several servers supplying various
> functions. They require a name server to be running first. How do I
> make it run? 

Several options, but most simply: by using the scripts supplied
into the distribution.

> What if another application has already set up a pyro
> name server (because if I use such a server it could be shut down
> prematurely by the other application)? How do I prevent other pyro
> applications from using my name server (etc.)?

Again, several options. When setting up Pyro clients / servers,
you can either specify a nameserver (in which case you can use
yours, and others can use theirs) or you can simply broadcast
for a nameserver -- probably on the same subnet, depending on
what your network devices do with broadcast packets. Unless
you have something very specific in mind, it probably doesn't
matter whose nameserver you use: you can set up sub-groups
within it so that your objects and other peoples' don't get
confused.

Additional info: you don't have to use a name server at all,
if you don't want to. It's perfectly possible to connect
directly to objects, if you know where they are.

> How do I make all processes run at once, and die at once (and
> gracefully)?

Now that really depends on what you're doing. More info
would help.

> What is usually done when one of the processes has an exception and
> dies? How do I make sure servers don't leave junk in the name server?

Usually, by careful exception handling on the client and
having an object which restarts clean up before itself.

> My main concern is that I'm missing some general concept and I would
> have to re-invent the wheel, so I'd appreciate any general comments or
> supernal insights on the subject.

You've doubtless read the Pyro docs, which I personally find
very useful, so either read again to see if more understanding
comes, or put together a small test scenario, try it out, and
then ask questions on the Pyro list.

HTH
Tim



More information about the Python-list mailing list