'Cope with reentrancy. If a particular consumer is still active when
another delivery appears for it, queue the deliveries up until it
finally exits.
:param pika.frame.Method method_frame: The method frame received
:param pika.frame.Header header_frame: The header frame received
:param body: The body received
:type body: str or unicode'

def _on_deliver(self, method_frame, header_frame, body):

    consumer_tag = method_frame.method.consumer_tag
    if (consumer_tag in self._cancelled):
        if (self.is_open and (consumer_tag not in self._consumers_with_noack)):
            self.basic_reject(method_frame.method.delivery_tag)
        return
    if (consumer_tag not in self._consumers):
        LOGGER.error('Unexpected    delivery:    %r', method_frame)
        return
    self._consumers[consumer_tag](self, method_frame.method, header_frame.properties, body)
