Skip to content

Commit

Permalink
Merge pull request #52 from nats-io/release/v0.7.2
Browse files Browse the repository at this point in the history
Release/v0.7.2
  • Loading branch information
wallyqs authored Aug 25, 2021
2 parents 63d868a + d2e98ae commit 8d0dcd2
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
nats-pure (0.7.0)
nats-pure (0.7.2)

GEM
remote: https://rubygems.org/
Expand Down Expand Up @@ -39,4 +39,4 @@ DEPENDENCIES
rspec

BUNDLED WITH
2.1.4
2.2.22
5 changes: 5 additions & 0 deletions lib/nats/io/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,11 @@ def old_request(subject, payload, opts={}, &blk)
end
response = sub.response

if response and response.header
status = response.header[STATUS_HDR]
raise NoRespondersError if status == "503"
end

response
end

Expand Down
4 changes: 2 additions & 2 deletions lib/nats/io/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2016-2018 The NATS Authors
# Copyright 2016-2021 The NATS Authors
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand All @@ -15,7 +15,7 @@
module NATS
module IO
# NOTE: These are all announced to the server on CONNECT
VERSION = "0.7.0"
VERSION = "0.7.2"
LANG = "#{RUBY_ENGINE}#{RUBY_VERSION}".freeze
PROTOCOL = 1
end
Expand Down
15 changes: 11 additions & 4 deletions spec/client_v2_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,22 @@
end

it 'should raise no responders error by default' do
nc = NATS::IO::Client.new
nc.connect(:servers => [@s.uri])
nc = NATS.connect(servers: [@s.uri])

resp = nil
expect do
resp = nc.request("hi", "timeout", timeout: 1)
expect(resp).to be_nil
end.to raise_error(NATS::IO::NoRespondersError)

expect(resp).to be_nil
expect do
resp = nc.request("hi", "timeout", timeout: 1, old_style: true)
expect(resp).to be_nil
end.to raise_error(NATS::IO::NoRespondersError)

expect do
resp = nc.old_request("hi", "timeout", timeout: 1)
expect(resp).to be_nil
end.to raise_error(NATS::IO::NoRespondersError)

resp = nil
expect do
Expand Down

0 comments on commit 8d0dcd2

Please sign in to comment.