Re: metadata and decorators are coming your way
Éric Piel <[email protected]> Wed, 09 Jul 2014 15:54:46 +0200
| Newsgroups | gmane.comp.python.pyro |
|---|---|
| Message-ID | <[email protected]> |
On 07/07/14 02:09, Irmen de Jong wrote: > Hi, > > I've just checked in the first batch of changes for Pyro 4.27 where a new feature is > coming: object metadata querying. > > This means that the the client (proxy) can ask the server about the methods and > attributes of the remote object. This query is done when the proxy is bound (connected). > For now, only the oneway methods are actually doing something: you don't have to > manually set _pyroOneway all the time on your proxy anymore! > > I also want to add some extra features based on this. For instance the method names > could be used for client-side error checking on invalid method calls, and perhaps the > attribute names can be used to implement truly transparent remote attribute access again > (like we had in Pyro 3.x) - but no promises there. > > For the oneway method metadata there's a new decorator @Pyro4.oneway that you can use on > the methods in your remote object, to mark them. I expect to add some more decorators, > see issue #44 on github. > > > If you have the time please check it out in the trunk version and let me know if you > have questions or ideas about all this! Hi Irmen, That's an exciting news! That's one of the main reason I had a fork of Pyro4 :-) Transparent remote attribute access would be great. Definitely, by default it should not be needed to add @exposed attribute to any method/attribute to have it shared. But it feels strange that if you just add one @expose, suddenly all the other things are hidden. Maybe a @noremote decorator to hide a specific method would be easier to use? Also, I'd love to see the proxy raise an AttributeError when an attribute/method doesn't exist (instead of returning a RemoteMethod). That'd would allow to have things like hasattr() work on a proxy too. It could be implemented by querying the metadata whenever access to an attribute yet unknown is done (so only the first access and the AttributeError exceptions would be a slow path). My 2 cents ;-) Best, Éric ------------------------------------------------------------------------------ Open source business process management suite built on Java and Eclipse Turn processes into business applications with Bonita BPM Community Edition Quickly connect people, data, and systems into organized workflows Winner of BOSSIE, CODIE, OW2 and Gartner awards http://p.sf.net/sfu/Bonitasoft