Part of elisa.core.utils.signal View In Hierarchy
A Signal is a 1-to-many communication system. It provides a way for two objects to communicate without knowing about each other. They only have to know about the signal object. Receivers objects connect to the signal and emitters can trigger the emission of the signal so that it is sent to all the receivers. Signal emission is synchronous, that is, the receivers are immediatly called upon emission, one after the other.
WARNING:
TODO:
Line # | Kind | Name | Docs |
---|---|---|---|
84 | Method | __init__ | Initialize a signal with the signature of receivers that can connect |
105 | Method | __repr__ | Textual representation of the Signal |
114 | Method | connect | Connect a receiver to the signal. It will be called when the signal |
134 | Method | disconnect | Disconnect a receiver from the signal. |
149 | Method | emit | Call all the connected receivers. It avoids calling the |
196 | Method | _check_args_types | Check the types of arguments and keywords comply with |
Parameters | name | name of the signal. Not unique, but developer friendly (type: string ) |
args_types | arguments types of the receivers that can connect to the signal (type: tuple of types ) | |
kw_types | arguments types of the receivers that can connect to the signal (type: dictionary of types ) |
Returns | information about the signal and its receivers (type: string ) |
Parameters | receiver | object to be called when the signal is emitted (type: callable ) |
args | parameters to send to the receiver when calling | |
kw | keywords to send to the receiver when calling | |
Raises | TypeError | if the receiver is not callable |
Parameters | receiver | object to be disconnected (type: callable ) |
Raises | IndexError | raised if the receiver is not in the list of receivers |
Parameters | args | arguments passed to the receivers (type: tuple ) |
kw | arguments passed to the receivers (type: dictionary ) | |
Raises | WrongArgument | if one of the arguments is of the wrong type |