protobuf-nats 0.9.0.pre1 → 0.9.0.pre2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +2 -0
- data/lib/protobuf/nats/client.rb +8 -2
- data/lib/protobuf/nats/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7b7a2ede49bfda45aadc50f2cc978e9ac6f4780
|
4
|
+
data.tar.gz: a6a6253219abc6417bcf87079da8d61694dfe941
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a6d7bc54084e79bf44ab56e1847823b37523eca4be6587509cf2a22682bdffd86ea25a574acac65a2e7e0dd92e04a1a173e0230a0b3ca02da1bad02db107400
|
7
|
+
data.tar.gz: a25d3136a2c8767f13fc163f298f905d69f19970db022ccdee4ee8baffaea402a54448770a822fa5b58218936f6e3e84406a8fc316aa0fc6360e17932be9c3eb
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -47,6 +47,8 @@ used to allow JVM based servers to warm-up slowly to prevent jolts in runtime pe
|
|
47
47
|
|
48
48
|
`PB_NATS_CLIENT_RECONNECT_DELAY` - If we detect a reconnect delay, we will wait this many seconds (default: the ACK timeout).
|
49
49
|
|
50
|
+
`PB_NATS_CLIENT_SUBSCRIPTION_POOL_SIZE` - If subscription pooling is desired for the request/response cycle then the pool size maximum should be set; the pool is lazy and therefore will only start new subscriptions as necessary (default: 0)
|
51
|
+
|
50
52
|
`PROTOBUF_NATS_CONFIG_PATH` - Custom path to the config yaml (default: "config/protobuf_nats.yml").
|
51
53
|
|
52
54
|
### YAML Config
|
data/lib/protobuf/nats/client.rb
CHANGED
@@ -58,7 +58,7 @@ module Protobuf
|
|
58
58
|
return_value = yield sub_inbox
|
59
59
|
end
|
60
60
|
else
|
61
|
-
|
61
|
+
return_value = yield new_subscription_inbox
|
62
62
|
end
|
63
63
|
|
64
64
|
return_value
|
@@ -128,7 +128,7 @@ module Protobuf
|
|
128
128
|
def send_request
|
129
129
|
if use_subscription_pooling?
|
130
130
|
available = self.class.subscription_pool.instance_variable_get("@available")
|
131
|
-
::ActiveSupport::Notifications.instrument "client.
|
131
|
+
::ActiveSupport::Notifications.instrument "client.subscription_pool_available_size.protobuf-nats", available.length
|
132
132
|
end
|
133
133
|
|
134
134
|
::ActiveSupport::Notifications.instrument "client.request_duration.protobuf-nats" do
|
@@ -203,6 +203,12 @@ module Protobuf
|
|
203
203
|
with_subscription do |sub_inbox|
|
204
204
|
begin
|
205
205
|
completed_request = false
|
206
|
+
|
207
|
+
if !sub_inbox.subscription.is_valid # replace the subscription if is has been pooled but is no longer valid (maybe a reconnect)
|
208
|
+
nats.unsubscribe(sub_inbox.subscription)
|
209
|
+
sub_inbox.swap(new_subscription_inbox) # this line replaces the sub_inbox in the connection pool if necessary
|
210
|
+
end
|
211
|
+
|
206
212
|
nats.publish(subject, data, sub_inbox.inbox)
|
207
213
|
|
208
214
|
# Wait for reply
|
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.9.0.
|
4
|
+
version: 0.9.0.pre2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Dewitt
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -199,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
199
199
|
version: 1.3.1
|
200
200
|
requirements: []
|
201
201
|
rubyforge_project:
|
202
|
-
rubygems_version: 2.
|
202
|
+
rubygems_version: 2.6.13
|
203
203
|
signing_key:
|
204
204
|
specification_version: 4
|
205
205
|
summary: ruby-protobuf client/server for nats
|