'Cancel consumer by queue name.'

def cancel_by_queue(self, queue):

    qname = (queue.name if isinstance(queue, Queue) else queue)
    try:
        tag = self._active_tags.pop(qname)
    except KeyError:
        pass
    else:
        self.channel.basic_cancel(tag)
    finally:
        self._queues.pop(qname, None)
