'Called by BlockingConnection to dispatch pending events.
`BlockingChannel` schedules this callback via
`BlockingConnection._request_channel_dispatch`'

def _dispatch_events(self):

    while self._pending_events:
        evt = self._pending_events.popleft()
        if (type(evt) is _ConsumerDeliveryEvt):
            consumer_info = self._consumer_infos[evt.method.consumer_tag]
            consumer_info.consumer_cb(self, evt.method, evt.properties, evt.body)
        elif (type(evt) is _ConsumerCancellationEvt):
            del self._consumer_infos[evt.method_frame.method.consumer_tag]
            self._impl.callbacks.process(self.channel_number, self._CONSUMER_CANCELLED_CB_KEY, self, evt.method_frame)
        else:
            evt.dispatch()
