• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python endpoint.SubscriberEndpointUnit类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: _make_routing_call

    def _make_routing_call(self, call, timeout, *op_args, **op_kwargs):
        if not self._routing_call:
            return SubscriberEndpointUnit._make_routing_call(self, call, timeout, *op_args, **op_kwargs)

        ctx = self._process.get_context()       # pull onto the locals here, for debuggability with manhole
        ar = self._routing_call(call, ctx, *op_args, **op_kwargs)
        return ar.get() # timeout=timeout)  # REMOVED TIMEOUT
开发者ID:j2project,项目名称:pyon,代码行数:7,代码来源:endpoint.py


示例2: _make_routing_call

    def _make_routing_call(self, call, timeout, *op_args, **op_kwargs):
        if not self._routing_call:
            return SubscriberEndpointUnit._make_routing_call(self, call, timeout, *op_args, **op_kwargs)

        ctx = self._process.get_context()
        ar = self._routing_call(call, ctx, *op_args, **op_kwargs)
        return ar.get()  # timeout=timeout)  # REMOVED TIMEOUT
开发者ID:edwardhunter,项目名称:scioncc,代码行数:7,代码来源:endpoint.py


示例3: _build_header

    def _build_header(self, raw_msg, raw_headers):
        """
        Override to direct the calls in _build_header - first the Subscriber, then the Process mixin.
        """
        header1 = SubscriberEndpointUnit._build_header(self, raw_msg, raw_headers)
        header2 = ProcessEndpointUnitMixin._build_header(self, raw_msg, raw_headers)

        header1.update(header2)

        return header1
开发者ID:edwardhunter,项目名称:scioncc,代码行数:10,代码来源:endpoint.py


示例4: _message_received

    def _message_received(self, msg, headers):
        """
        Message received override.

        Sets the process' context here to be picked up by subsequent calls out by this service to other services, or replies.
        """
        ######
        ###### THIS IS WHERE THE THREAD LOCAL HEADERS CONTEXT IS SET ######
        ######

        # With the property _routing_call set, as is the case 95% of the time in the Process-level endpoints,
        # we have to set the call context from the ION process' calling greenlet, as context is greenlet-specific.
        # This is done in the _make_routing_call override here, passing it the context to be set.
        # See also IonProcessThread._control_flow.

        with self._process.push_context(headers):
            return SubscriberEndpointUnit._message_received(self, msg, headers)
开发者ID:j2project,项目名称:pyon,代码行数:17,代码来源:endpoint.py


示例5: __init__

 def __init__(self, process=None, callback=None, routing_call=None, **kwargs):
     ProcessEndpointUnitMixin.__init__(self, process=process)
     SubscriberEndpointUnit.__init__(self, callback=callback, **kwargs)
     self._routing_call = routing_call
开发者ID:j2project,项目名称:pyon,代码行数:4,代码来源:endpoint.py


示例6: _make_routing_call

    def _make_routing_call(self, call, *op_args, **op_kwargs):
        if not self._routing_call:
            return SubscriberEndpointUnit._make_routing_call(self, call, *op_args, **op_kwargs)

        ar = self._routing_call(call, self._process.get_context(), *op_args, **op_kwargs)
        return ar.get()     # @TODO: timeout?
开发者ID:swarbhanu,项目名称:pyon,代码行数:6,代码来源:endpoint.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python transport.AMQPTransport类代码示例发布时间:2022-05-27
下一篇:
Python endpoint.Subscriber类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap