lib/nats/io/jetstream/msg/ack_methods.rb in nats-pure-2.2.1 vs lib/nats/io/jetstream/msg/ack_methods.rb in nats-pure-2.3.0

- old
+ new

@@ -39,15 +39,19 @@ resp end def nak(**params) ensure_is_acked_once! - + payload = if params[:delay] + payload = "#{Ack::Nak} #{{ delay: params[:delay] }.to_json}" + else + Ack::Nak + end resp = if params[:timeout] - @nc.request(@reply, Ack::Nak, **params) + @nc.request(@reply, payload, **params) else - @nc.publish(@reply, Ack::Nak) + @nc.publish(@reply, payload) end @sub.synchronize { @ackd = true } resp end @@ -102,6 +106,6 @@ Metadata.new(tokens) end end end end -end \ No newline at end of file +end