# File lib/nats/client.rb, line 493 def publish(subject, msg=EMPTY_MSG, opt_reply=nil, &blk) return unless subject and not @drained_subs msg = msg.to_s # Accounting @msgs_sent += 1 @bytes_sent += msg.bytesize if msg send_command("PUB #{subject} #{opt_reply} #{msg.bytesize}#{CR_LF}#{msg}#{CR_LF}") queue_server_rt(&blk) if blk end