def publish(self, subject, msg, reply=None):
        if msg is None:
            msg = ''

        if reply is None:
            command = 'PUB %s %d' % (subject, len(msg))
        else:
            command = 'PUB %s %s %d' % (subject, reply, len(msg))

        self._send(command)
        self._send(msg)
Publish publishes the data argument to the given subject.
dataset/ETHPy150Open mcuadros/pynats/pynats/connection.py/Connection.publish