Anyone Written a ReconnectingProxy Object?

Kent Borg <[email protected]>
Newsgroups gmane.comp.python.pyro
Message-ID <[email protected]>
Newbie here,

I am looking at Pyro4 as a way of letting different Python processes 
coordinate (on the same computer). They are loosely coupled, they will 
run constantly, server-style, so I like the idea that if my Pyro server 
needs to restart, the other processes don't also need to be restarted.  
Like I said, loosely coupled.

So the reconnect feature is cool.


Another thing I like about Pyro is that, once I get the server/client 
stuff working, I can go back to (mostly) just writing Python, not lots 
of Pyro stuff, just Python!


Except! Those dang reconnect "try/except" clauses I need to put 
everywhere--that's not clean Python.


So, I tried subclassng the Proxy object and writing a ReconnectingProxy 
object, wrapping key methods with the try/except stuff to get them to 
reconnect.  I thought I had it working earlier today, but for some 
reason my object isn't getting the exceptions. If I put them out in the 
main code, I do get the exceptions, but not in my object.

Anyone already done this?  Catch the exception, reconnect, and (I guess) 
try the original method call one more time. Users of the proxy just 
treat it like an object that is more persistent than the regular Proxy 
object...


Thanks,

-kb


------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.