'Invoked by pika when RabbitMQ responds to a Basic.Publish RPC
command, passing in either a Basic.Ack or Basic.Nack frame with
the delivery tag of the message that was published. The delivery tag
is an integer counter indicating the message number that was sent
on the channel via Basic.Publish. Here we\'re just doing house keeping
to keep track of stats and remove message numbers that we expect
a delivery confirmation of from the list used to keep track of messages
that are pending confirmation.
:param pika.frame.Method method_frame: Basic.Ack or Basic.Nack frame'

def on_delivery_confirmation(self, method_frame):

    confirmation_type = method_frame.method.NAME.split('.')[1].lower()
    LOGGER.info('Received    %s    for    delivery    tag:    %i', confirmation_type, method_frame.method.delivery_tag)
    if (confirmation_type == 'ack'):
        self._acked += 1
    elif (confirmation_type == 'nack'):
        self._nacked += 1
    self._deliveries.remove(method_frame.method.delivery_tag)
    LOGGER.info('Published    %i    messages,    %i    have    yet    to    be    confirmed,    %i    were    acked    and    %i    were    nacked', self._message_number, len(self._deliveries), self._acked, self._nacked)
