remote_service.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:gemstone 作者: vladcalin 项目源码 文件源码
def call_method(self, method_name_or_object, params=None):
        """
        Calls the ``method_name`` method from the given service and returns a
        :py:class:`gemstone.client.structs.Result` instance.

        :param method_name_or_object: The name of te called method or a ``MethodCall`` instance
        :param params: A list of dict representing the parameters for the request
        :return: a :py:class:`gemstone.client.structs.Result` instance.
        """
        if isinstance(method_name_or_object, MethodCall):
            req_obj = method_name_or_object
        else:
            req_obj = MethodCall(method_name_or_object, params)
        raw_response = self.handle_single_request(req_obj)
        response_obj = Result(result=raw_response["result"], error=raw_response['error'],
                              id=raw_response["id"], method_call=req_obj)
        return response_obj
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号