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


Python Signal.receiver_connected方法代碼示例

本文整理匯總了Python中blinker.Signal.receiver_connected方法的典型用法代碼示例。如果您正苦於以下問題:Python Signal.receiver_connected方法的具體用法?Python Signal.receiver_connected怎麽用?Python Signal.receiver_connected使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在blinker.Signal的用法示例。


在下文中一共展示了Signal.receiver_connected方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: receiver_disconnected

# 需要導入模塊: from blinker import Signal [as 別名]
# 或者: from blinker.Signal import receiver_connected [as 別名]
def receiver_disconnected(self):
        """Emitted after :meth:`disconnect`.

        The sender is the signal instance, and the :meth:`disconnect` arguments
        are passed through: *receiver* and *sender*.

        Note, this signal is emitted **only** when :meth:`disconnect` is
        called explicitly.

        The disconnect signal can not be emitted by an automatic disconnect
        (due to a weakly referenced receiver or sender going out of scope),
        as the receiver and/or sender instances are no longer available for
        use at the time this signal would be emitted.

        An alternative approach is available by subscribing to
        :attr:`receiver_connected` and setting up a custom weakref cleanup
        callback on weak receivers and senders.

        .. versionadded:: 1.2

        """
        return Signal(doc="Emitted after a receiver disconnects.") 
開發者ID:sugarguo,項目名稱:Flask_Blog,代碼行數:24,代碼來源:base.py

示例2: receiver_connected

# 需要導入模塊: from blinker import Signal [as 別名]
# 或者: from blinker.Signal import receiver_connected [as 別名]
def receiver_connected(self):
        """Emitted after each :meth:`connect`.

        The signal sender is the signal instance, and the :meth:`connect`
        arguments are passed through: *receiver*, *sender*, and *weak*.

        .. versionadded:: 1.2

        """
        return Signal(doc="Emitted after a receiver connects.") 
開發者ID:sugarguo,項目名稱:Flask_Blog,代碼行數:12,代碼來源:base.py


注:本文中的blinker.Signal.receiver_connected方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。