def notifyOnConnect(self):
        """
        Connection notification.

        @return: A L{Deferred} that fires when this instance's
            L{twisted.internet.interfaces.IConnector.connect} method
            is called.
        @rtype: L{Deferred}
        """
        notifier = Deferred()
        self.notifications.appendleft(notifier)
        return notifier

        Connection notification.

        @return: A L{Deferred} that fires when this instance's
            L{twisted.internet.interfaces.IConnector.connect} method
            is called.
        @rtype: L{Deferred}
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/spread/test/test_pb.py