當前位置: 首頁>>代碼示例>>Python>>正文


Python endpoint.SubscriberEndpointUnit類代碼示例

本文整理匯總了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;未經允許,請勿轉載。