INNER CODE UNIT · Python

__init__

permitio/fastapi_websocket_rpc · fastapi_websocket_rpc/rpc_channel.py:81

    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
    """

    def __init__(self, channel, methods=None) -> None:
        self._channel = channel
        self._method_names = (
            [method[0] for method in getmembers(methods, lambda i: ismethod(i))]
            if methods is not None

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…