'Run the example code by connecting and then starting the IOLoop.'

def run(self):

    while (not self._stopping):
        self._connection = None
        self._deliveries = []
        self._acked = 0
        self._nacked = 0
        self._message_number = 0
        try:
            self._connection = self.connect()
            self._connection.ioloop.start()
        except KeyboardInterrupt:
            self.stop()
            if ((self._connection is not None) and (not self._connection.is_closed)):
                self._connection.ioloop.start()
    LOGGER.info('Stopped')
