Re: autoproxy example only works with pickle
Irmen de Jong <[email protected]>
| Newsgroups | gmane.comp.python.pyro |
|---|---|
| Message-ID | <[email protected]> |
On 26-6-2013 18:01, Matt Nelson wrote: > I did a little more testing, and now I'm confused about the relationship > between serializing and proxying. > > If I try the autoproxy example autoproxy turned off, I get the same error as > when autoproxy is turned on: "Pyro4.errors.ProtocolError: unsupported > serialized class: Thingy". Yes, autoproxying currently only works when the serializer is pickle. > However, if I modify the server to return a URI instead of an instance, and > modify the client to create a proxy using the URI, then the example runs. Sure, an URI is just a string. Or a Pyro4.core.URI. In which case it also works because Pyro contains special logic to deal with these. > So I can't return an instance, with or without autoproxy, because of a > serialization problem. But I can return a URI and have the client create a > proxy for an instance of the same class, which succeeds. Does manual > proxying use some mechanism other than serialization? Proxying is a different thing as serialization. You could say it is the opposite. When objects need to travel over the network, Pyro needs to serialize them to send them to the other side. A proxy on the other hand, is a representative of something that still lives on the other side of the wire. That something never travels over the wire by itself, so that something doesn't need to be serialized. The proxy for that something however, does. And as with a URI does Pyro contain some special logic to deal with proxy objects as well. Some details here: http://pythonhosted.org/Pyro4/tutorials.html#pyro-concepts-and-tools Irmen ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev