def run(self, driver_id, ts, fields, tags):
    if (not fields):
        return
    msg = format_msg(ts, driver_id, tags, fields)
    try:
        with pika.BlockingConnection(pika.ConnectionParameters(*self._args, **self._kwargs)) as c:
            channel = c.channel()
            self._publish(channel, msg)
            if (self._buffer is not None):
                try:
                    while True:
                        msg = self._buffer.get_nowait()
                        self._publish(channel, msg)
                except Empty:
                    pass
    except pika.exceptions.AMQPError:
        if (self._buffer is not None):
            try:
                self._buffer.put_nowait(msg)
            except Full:
                pass
def run(self, driver_id, ts, fields, tags):
    if (not fields):
        return
    msg = format_msg(ts, driver_id, tags, fields)
    try:
        with pika.BlockingConnection(pika.ConnectionParameters(*self._args, **self._kwargs)) as c:
            channel = c.channel()
            self._publish(channel, msg)
            if (self._buffer is not None):
                try:
                    while True:
                        msg = self._buffer.get_nowait()
                        self._publish(channel, msg)
                except Empty:
                    pass
    except pika.exceptions.AMQPError:
        if (self._buffer is not None):
            try:
                self._buffer.put_nowait(msg)
            except Full:
                pass