本文整理汇总了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.")
示例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.")