Re: Anyone Written a ReconnectingProxy Object?
Andreas Kostyrka <[email protected]>
| Newsgroups | gmane.comp.python.pyro |
|---|---|
| Message-ID | <CAMWQy6ak+x1qdsGS8=DZdQjQEvHtYUC5Ro1syjBd87FfS==8tA@mail.gmail.com> |
Try finally automatically makes me think about with statements and contextlib which allows to express the finally part. Am 30.06.2013 22:35 schrieb "Kent Borg" <[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 > _______________________________________________ > Pyro-core mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/pyro-core > ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev _______________________________________________ Pyro-core mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/pyro-core