Class e.c.u.s.Signal(object):

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
def __init__(self, name, *args_types, **kw_types):
Initialize a signal with the signature of receivers that can connect to it.
Parametersnamename of the signal. Not unique, but developer friendly (type: string )
args_typesarguments types of the receivers that can connect to the signal (type: tuple of types )
kw_typesarguments types of the receivers that can connect to the signal (type: dictionary of types )
def __repr__(self):
Textual representation of the Signal
Returnsinformation about the signal and its receivers (type: string )
def connect(self, receiver, *args, **kw):
Connect a receiver to the signal. It will be called when the signal is emitted.
Parametersreceiverobject to be called when the signal is emitted (type: callable )
argsparameters to send to the receiver when calling
kwkeywords to send to the receiver when calling
RaisesTypeErrorif the receiver is not callable
def disconnect(self, receiver):
Disconnect a receiver from the signal.
Parametersreceiverobject to be disconnected (type: callable )
RaisesIndexErrorraised if the receiver is not in the list of receivers
def emit(self, *args, **kw):
Call all the connected receivers. It avoids calling the neutralized ones. Since receivers calling is not ordered, one should be careful with the potential side effects in the receivers.
Parametersargsarguments passed to the receivers (type: tuple )
kwarguments passed to the receivers (type: dictionary )
RaisesWrongArgumentif one of the arguments is of the wrong type
def _check_args_types(self, args, kw):
Check the types of arguments and keywords comply with types specifications given at Signal creation.
RaisesWrongArgumentif one of the arguments is of the wrong type
API Documentation for Elisa Media Center, generated by pydoctor at 2009-02-16 19:15:05.