INNER CODE UNIT · Python
RpcProxy
permitio/fastapi_websocket_rpc · fastapi_websocket_rpc/rpc_channel.py:75
class RpcProxy:
"""
Helper class
provide a __call__ interface for an RPC method over a given channel
"""
def __init__(self, channel, method_name) -> None:
self.method_name = method_name
self.channel = channel
def __call__(self, **kwds: Any) -> Any:
return self.channel.call(self.method_name, args=kwds)
class RpcCaller:
"""
Helper class provide an object (aka other) with callable methods for each remote method on the otherside
"""