code: def stop(self):
          
          _logger.debug('Stopping')
          self._closing = True
          self.stop_consuming()
          self._connection.ioloop.start()
          _logger.info('Stopped')
docs: Cleanly shutdown the connection to RabbitMQ by stopping the consumer
          with RabbitMQ. When RabbitMQ confirms the cancellation, on_cancelok
          will be invoked by pika, which will then closing the channel and
          connection. The IOLoop is started again because this method is invoked
          when CTRL-C is pressed raising a KeyboardInterrupt exception. This
          exception stops the IOLoop which needs to be running for pika to
          communicate with RabbitMQ. All of the commands issued prior to starting
          the IOLoop will be buffered but not processed.