INNER CODE UNIT · Python

__call__

permitio/fastapi_websocket_rpc · fastapi_websocket_rpc/rpc_channel.py:85

    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
            else None
        )

    def __getattribute__(self, name: str):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…