All public API members can (and should) be imported from blinker:
from blinker import ANY, signal
Sent by a Signal after a receiver connects.
Argument: | the Signal that was connected to |
---|---|
Parameters: |
|
A notification emitter.
Parameter: | doc – optional. If provided, will be assigned to the signal’s __doc__ attribute. |
---|
A mapping of connected receivers.
The values of this mapping are not meaningful outside of the internal Signal implementation, however the boolean value of the mapping is useful as an extremely efficient check to see if any receivers are connected to the signal.
Connect receiver to signal events sent by sender.
Parameters: |
|
---|
Connect the decorated function as a receiver for sender.
Parameters: |
|
---|
New in version 1.1.
Execute a block with the signal temporarily connected to receiver.
Parameters: |
|
---|
This is a context manager for use in the with statement. It can be useful in unit tests. receiver is connected to the signal for the duration of the with block, and will be disconnected automatically when exiting the block:
with on_ready.connected_to(receiver):
# do stuff
on_ready.send(123)
New in version 1.1.
Disconnect receiver from this signal’s events.
Parameters: |
---|
True if there is probably a receiver for sender.
Performs an optimistic check only. Does not guarantee that all weakly referenced receivers are still alive. See receivers_for() for a stronger search.
Emit this signal on behalf of sender, passing on **kwargs.
Returns a list of 2-tuples, pairing receivers with their return value. The ordering of receiver notification is undefined.
Parameters: |
|
---|
An alias for connected_to().
Parameters: |
|
---|
New in version 0.9.
Changed in version 1.1: Renamed to connected_to(). temporarily_connected_to will be deprecated in 1.2 and removed in a subsequent version.
Return the NamedSignal name, creating it if required.
Repeated calls to this function will return the same signal object. Signals are created in a global Namespace.
Bases: blinker.base.Signal
A named generic notification emitter.
Bases: weakref.WeakValueDictionary
A mapping of signal names to signals.
Return the NamedSignal name, creating it if required.
Repeated calls to this function will return the same signal object.