code: def close(self):
          
          if self.connection:
              logging.info("Closing connection to {}.".format(self.host))
              self.connection.close()
              self.connection = None
docs: Close internal connection to AMQP if connected.