INNER CODE UNIT · Python

__init__

permitio/fastapi_websocket_rpc · fastapi_websocket_rpc/rpc_channel.py:94

    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):
        if (not name.startswith("_") or name in EXPOSED_BUILT_IN_METHODS) and (
            self._method_names is None or name in self._method_names
        ):
            return RpcProxy(self._channel, name)
        else:
            return super().__getattribute__(name)


# Callback signatures

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…