protobuf-nats 0.10.1 → 0.10.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -0
- data/lib/protobuf/nats/client.rb +10 -4
- data/lib/protobuf/nats/errors.rb +3 -3
- data/lib/protobuf/nats/version.rb +1 -1
- data/protobuf-nats.gemspec +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56bd1c8b7367534bdb06a6e92afb1a3593c8333157a2ab7b348d3813d7c7bc7d
|
4
|
+
data.tar.gz: 1ea7763925d8aac77092945de99e50707905eb2c21ea657ecca9c12fe98df4f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1963bcda2ae4fd5f1f9c36d6778625300a2a1557963ef4b7622a04eee764c4b5d0a0d79efe9a2d71b447d29258842b0438bd1a6f6436b22f2ec6b3b72fbc265c
|
7
|
+
data.tar.gz: a1f321734d00671c43f0b2b22c447cf5c991ec734ff6c015058592e0ebde6facc6955a4fa9c2e38969862d56fd8a3c78d577f6882b45a9498ad34e9c1bc47ed0
|
data/.travis.yml
CHANGED
data/lib/protobuf/nats/client.rb
CHANGED
@@ -151,12 +151,12 @@ module Protobuf
|
|
151
151
|
when :ack_timeout
|
152
152
|
::ActiveSupport::Notifications.instrument "client.request_timeout.protobuf-nats"
|
153
153
|
next if (retries -= 1) > 0
|
154
|
-
raise ::Protobuf::Nats::Errors::RequestTimeout
|
154
|
+
raise ::Protobuf::Nats::Errors::RequestTimeout, formatted_service_and_method_name
|
155
155
|
when :nack
|
156
156
|
::ActiveSupport::Notifications.instrument "client.request_nack.protobuf-nats"
|
157
157
|
interval = nack_backoff_intervals[nack_retry]
|
158
158
|
nack_retry += 1
|
159
|
-
raise ::Protobuf::Nats::Errors::RequestTimeout if interval.nil?
|
159
|
+
raise ::Protobuf::Nats::Errors::RequestTimeout, formatted_service_and_method_name if interval.nil?
|
160
160
|
sleep((interval + nack_backoff_splay)/1000.0)
|
161
161
|
next
|
162
162
|
end
|
@@ -186,6 +186,12 @@ module Protobuf
|
|
186
186
|
end
|
187
187
|
end
|
188
188
|
|
189
|
+
def formatted_service_and_method_name
|
190
|
+
klass = @options[:service]
|
191
|
+
method_name = @options[:method]
|
192
|
+
"#{klass}##{method_name}"
|
193
|
+
end
|
194
|
+
|
189
195
|
# The Java nats client offers better message queueing so we're going to use
|
190
196
|
# that over locking ourselves. This split in code isn't great, but we can
|
191
197
|
# refactor this later.
|
@@ -231,7 +237,7 @@ module Protobuf
|
|
231
237
|
else return :ack_timeout
|
232
238
|
end
|
233
239
|
|
234
|
-
fail(::Protobuf::Nats::Errors::ResponseTimeout,
|
240
|
+
fail(::Protobuf::Nats::Errors::ResponseTimeout, formatted_service_and_method_name) unless response
|
235
241
|
|
236
242
|
completed_request = true
|
237
243
|
response
|
@@ -287,7 +293,7 @@ module Protobuf
|
|
287
293
|
else return :ack_timeout
|
288
294
|
end
|
289
295
|
|
290
|
-
fail(::Protobuf::Nats::Errors::ResponseTimeout,
|
296
|
+
fail(::Protobuf::Nats::Errors::ResponseTimeout, formatted_service_and_method_name) unless response
|
291
297
|
|
292
298
|
response
|
293
299
|
ensure
|
data/lib/protobuf/nats/errors.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
module Protobuf
|
2
2
|
module Nats
|
3
3
|
module Errors
|
4
|
-
class
|
4
|
+
class ClientError < ::StandardError
|
5
5
|
end
|
6
6
|
|
7
|
-
class RequestTimeout <
|
7
|
+
class RequestTimeout < ClientError
|
8
8
|
end
|
9
9
|
|
10
|
-
class ResponseTimeout <
|
10
|
+
class ResponseTimeout < ClientError
|
11
11
|
end
|
12
12
|
|
13
13
|
class MriIOException < ::StandardError
|
data/protobuf-nats.gemspec
CHANGED
@@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
|
|
35
35
|
spec.add_runtime_dependency "protobuf", "~> 3.7", ">= 3.7.2"
|
36
36
|
spec.add_runtime_dependency "nats-pure", "~> 0.3", "< 0.4"
|
37
37
|
|
38
|
-
spec.add_development_dependency "bundler"
|
38
|
+
spec.add_development_dependency "bundler"
|
39
39
|
spec.add_development_dependency "rake", "~> 10.0"
|
40
40
|
spec.add_development_dependency "rspec"
|
41
41
|
spec.add_development_dependency "benchmark-ips"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: protobuf-nats
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Dewitt
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -82,16 +82,16 @@ dependencies:
|
|
82
82
|
name: bundler
|
83
83
|
requirement: !ruby/object:Gem::Requirement
|
84
84
|
requirements:
|
85
|
-
- - "
|
85
|
+
- - ">="
|
86
86
|
- !ruby/object:Gem::Version
|
87
|
-
version: '
|
87
|
+
version: '0'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
90
|
version_requirements: !ruby/object:Gem::Requirement
|
91
91
|
requirements:
|
92
|
-
- - "
|
92
|
+
- - ">="
|
93
93
|
- !ruby/object:Gem::Version
|
94
|
-
version: '
|
94
|
+
version: '0'
|
95
95
|
- !ruby/object:Gem::Dependency
|
96
96
|
name: rake
|
97
97
|
requirement: !ruby/object:Gem::Requirement
|