#NEWLINE# def notifyOnDeath( self , cb ) : #NEWLINE# #INDENT# ' Method is used to  to register a callback which will be called\n            when the connection died.\n\n            @param cb:          Callback which should be registered. The\n                                callback should take the died connection as\n                                only argument.\n            @type  cb:          callable\n        ' #NEWLINE# assert callable ( cb ) #NEWLINE# try : #NEWLINE# #INDENT# self . _cbs . add ( cb ) #NEWLINE# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# raise AlreadyDead ( '{0} is already dead.' . format ( self . __class__ . __name__ ) )