'Called by impl when broker cancels consumer via Basic.Cancel.
This is a RabbitMQ-specific feature. The circumstances include deletion
of queue being consumed as well as failure of a HA node responsible for
the queue being consumed.
:param pika.frame.Method method_frame: method frame with the
`spec.Basic.Cancel` method'

def _on_consumer_cancelled_by_broker(self, method_frame):

    evt = _ConsumerCancellationEvt(method_frame)
    consumer = self._consumer_infos[method_frame.method.consumer_tag]
    if (not consumer.tearing_down):
        consumer.state = _ConsumerInfo.CANCELLED_BY_BROKER
    if (consumer.alternate_event_sink is not None):
        consumer.alternate_event_sink(evt)
    else:
        self._add_pending_event(evt)
