def cancel(self, consumer_tag='', nowait=True, consumer=None, cb=None):
        '''
        Cancel a consumer. Can choose to delete based on a consumer tag or
        the function which is consuming.  If deleting by function, take care
        to only use a consumer once per channel.
        '''
        # Remove the consumer's broker-cancel callback entry
        if consumer:
            tag = self._lookup_consumer_tag_by_consumer(consumer)
            if tag:
                consumer_tag = tag

        try:
            del self._broker_cancel_cb_map[consumer_tag]
        except KeyError:
            self.logger.warning(
                'cancel: no broker-cancel-cb entry for consumer tag %r '
                '(consumer %r)', consumer_tag, consumer)

        # Cancel consumer
        super(RabbitBasicClass, self).cancel(consumer_tag, nowait, consumer, cb)