[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

rpc shortcut

Aaron Brady

3/1/2008 8:10:00 PM

RPC might be -really- easy.

Mixin class:

getattribute returns a remoting callable if ('name') is callable, or
in a special list. On call, pack the parameters, execute locally, and
broadcast. You'd need two mixins, BroadcasterMixin and ReceiverMixin,
but the same code can still run-- how can behavior depend on whether a
given class is listening or "talking" in a given instance?

Also, customize mixins: BcastMixin, RceiveMixin with ServerSideMixin,
ClientSideMixin, or BothSidesMixin, the first two executing state
change in one place, and informing of the new state, or independently,
opt'ly with some verification in worries of non-determinism. Or,
perhaps, @ServerSide and @ClientSide decorations.

It sucks when bandwidth cost might depend on certain parameters-- big
state changes vs. big processing time vs. big parameter lists
comparatively, esp'ly when they aren't right as separate functions...
though do cf. multimethods for param. value checking on this:
@servside @params( 'i', lambda i: i> 100 ) def func( i ) / @cliside
@params( default ) def func( i ).