'Cancel all associated messages and close the Channel.
This cancels all consumers by calling :meth:`basic_cancel` for each
known consumer_tag. It also closes the self._broker sessions. Closing
the sessions implicitly causes all outstanding, un-ACKed messages to
be considered undelivered by the broker.'

def close(self):

    if (not self.closed):
        self.closed = True
        for consumer_tag in self._receivers.keys():
            self.basic_cancel(consumer_tag)
        if (self.connection is not None):
            self.connection.close_channel(self)
        self._broker.close()
