rpc shortcut

castironpi at gmail.com castironpi at gmail.com
Sat Mar 1 15:09:30 EST 2008


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 ).



More information about the Python-list mailing list