'This method tells pika to call the on_channel_closed method if
RabbitMQ unexpectedly closes the channel.'

def add_on_channel_close_callback(self):

    LOGGER.info('Adding    channel    close    callback')
    self._channel.add_on_close_callback(self.on_channel_closed)
