diff --git a/sjrpc/utils/handlers.py b/sjrpc/utils/handlers.py index d0eedf90e57bf33dde59f0e82c88034a6170dfab..7529f9ddb5ec3e9f5d9968ee03d39cdeafbbe0b0 100644 --- a/sjrpc/utils/handlers.py +++ b/sjrpc/utils/handlers.py @@ -4,6 +4,9 @@ class RpcHandler(object): ''' Basic RPC functions handler. + + Derive this call in your handler and define some methods. All the defined + methods (including privates) are available to your peer. ''' def __getitem__(self, name): @@ -12,8 +15,9 @@ class RpcHandler(object): else: raise KeyError(name) - +# # Decorators: +# def threadless(func): ''' @@ -27,7 +31,7 @@ def threadless(func): def pure(func): ''' Function handler decorator -- the function is a pure fonction, caller will - not pass :class:`RpcConnection` object in call parameters. + not pass :class:`RpcConnection` object as first call parameters. ''' func.__pure__ = True diff --git a/sjrpc/utils/proxies.py b/sjrpc/utils/proxies.py index b58d21a9cadba9686d4d247df77f6dd6298a734b..242f98f789bc5ccfbfb815f57a4ef033e1c41f71 100644 --- a/sjrpc/utils/proxies.py +++ b/sjrpc/utils/proxies.py @@ -20,6 +20,9 @@ class ConnectionProxy(object): >>> proxy.unknown_function() [Traceback] NameError: remote name 'unknown_function' is not defined + + >>> proxy['myfunc']() # You can also use this syntax + ... ''' def __init__(self, connection):