当前位置: 首页>>代码示例>>Python>>正文


Python RPCResponseEndpointUnit.message_received方法代码示例

本文整理汇总了Python中pyon.net.endpoint.RPCResponseEndpointUnit.message_received方法的典型用法代码示例。如果您正苦于以下问题:Python RPCResponseEndpointUnit.message_received方法的具体用法?Python RPCResponseEndpointUnit.message_received怎么用?Python RPCResponseEndpointUnit.message_received使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyon.net.endpoint.RPCResponseEndpointUnit的用法示例。


在下文中一共展示了RPCResponseEndpointUnit.message_received方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_message_received_dict

# 需要导入模块: from pyon.net.endpoint import RPCResponseEndpointUnit [as 别名]
# 或者: from pyon.net.endpoint.RPCResponseEndpointUnit import message_received [as 别名]
    def test_message_received_dict(self):
        rout_obj = Mock()
        e = RPCResponseEndpointUnit(routing_obj=rout_obj)

        msg_dict = {'iam':'adict'}
        e.message_received(msg_dict, {'op':'anyop'})

        rout_obj.anyop.assert_called_once_with(iam='adict')
开发者ID:daf,项目名称:pyon,代码行数:10,代码来源:test_endpoint.py

示例2: test_message_received_dict

# 需要导入模块: from pyon.net.endpoint import RPCResponseEndpointUnit [as 别名]
# 或者: from pyon.net.endpoint.RPCResponseEndpointUnit import message_received [as 别名]
    def test_message_received_dict(self):
        rout_obj = Mock()
        e = RPCResponseEndpointUnit(routing_obj=rout_obj)

        msg_dict = {"iam": "adict"}
        e.message_received(msg_dict, {"op": "anyop"})

        rout_obj.anyop.assert_called_once_with(iam="adict")
开发者ID:ooici-dm,项目名称:pyon,代码行数:10,代码来源:test_endpoint.py

示例3: message_received

# 需要导入模块: from pyon.net.endpoint import RPCResponseEndpointUnit [as 别名]
# 或者: from pyon.net.endpoint.RPCResponseEndpointUnit import message_received [as 别名]
    def message_received(self, msg, headers):
        #This is the hook for checking governance pre-conditions before calling a service operation
        #TODO - replace with a process specific interceptor stack of some sort.
        gc = self._routing_obj.container.governance_controller
        if gc:
            gc.check_process_operation_preconditions(self._routing_obj, msg, headers)

        result, response_headers = RPCResponseEndpointUnit.message_received(self, msg, headers)

        # decorate our response_headers with process-saturation, as we need them to be set in the headers
        # earlier than send/build_header so the sampling takes notice
        try:
            response_headers['process-saturation'] = self._get_process_saturation()
        except Exception as ex:
            log.warn("Could not set process-saturation header, ignoring: %s", ex)

        return result, response_headers
开发者ID:j2project,项目名称:pyon,代码行数:19,代码来源:endpoint.py


注:本文中的pyon.net.endpoint.RPCResponseEndpointUnit.message_received方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。