'Close channel.
Cancel all consumers, and requeue unacked messages.'

def close(self):

    if (not self.closed):
        self.closed = True
        for consumer in list(self._consumers):
            self.basic_cancel(consumer)
        if self._qos:
            self._qos.restore_unacked_once()
        if (self._cycle is not None):
            self._cycle.close()
            self._cycle = None
        if (self.connection is not None):
            self.connection.close_channel(self)
    self.exchange_types = None
