nats-pure 0.2.2 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nats/io/client.rb +7 -3
- data/lib/nats/io/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: 44273223e517bfe16e454408baba484fb3a80d8c
|
4
|
+
data.tar.gz: 2cfa6aaae35c049279ae72d637c58aeabdd7e035
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f816d3cef57c6527ceae6e7dea24ec1ffd99f097ba97a8292ae1db20e3718d417f12661471830806038d0a2018deb9844c5dc57513c0c2482c1501795edfc605
|
7
|
+
data.tar.gz: 9304d8711e83748d065f9ab1eddca0528b97f11d84aaec870726d6907c51343898da7656983d402e0c6ec723b41e5246bb504896332008ba0a304bc153bd27e9
|
data/lib/nats/io/client.rb
CHANGED
@@ -264,8 +264,12 @@ module NATS
|
|
264
264
|
# Create subscription which is dispatched asynchronously
|
265
265
|
# messages to a callback.
|
266
266
|
def subscribe(subject, opts={}, &callback)
|
267
|
-
sid =
|
268
|
-
sub =
|
267
|
+
sid = nil
|
268
|
+
sub = nil
|
269
|
+
synchronize do
|
270
|
+
sid = (@ssid += 1)
|
271
|
+
sub = @subs[sid] = Subscription.new
|
272
|
+
end
|
269
273
|
sub.subject = subject
|
270
274
|
sub.callback = callback
|
271
275
|
sub.received = 0
|
@@ -437,7 +441,7 @@ module NATS
|
|
437
441
|
return
|
438
442
|
when sub.received == sub.max
|
439
443
|
# Cleanup here if we have hit the max..
|
440
|
-
@subs.delete(sid)
|
444
|
+
synchronize { @subs.delete(sid) }
|
441
445
|
end
|
442
446
|
end
|
443
447
|
|
data/lib/nats/io/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nats-pure
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Waldemar Quevedo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: NATS is an open-source, high-performance, lightweight cloud messaging
|
14
14
|
system.
|
@@ -41,7 +41,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
41
41
|
version: '0'
|
42
42
|
requirements: []
|
43
43
|
rubyforge_project:
|
44
|
-
rubygems_version: 2.
|
44
|
+
rubygems_version: 2.5.2
|
45
45
|
signing_key:
|
46
46
|
specification_version: 4
|
47
47
|
summary: NATS is an open-source, high-performance, lightweight cloud messaging system.
|