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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d7cfcdf1243c5e666ab143dfc2455382b6e005d4
4
- data.tar.gz: 5b14efd741a22149d8b2d2f32cc2b9f1ae3d26d2
3
+ metadata.gz: 44273223e517bfe16e454408baba484fb3a80d8c
4
+ data.tar.gz: 2cfa6aaae35c049279ae72d637c58aeabdd7e035
5
5
  SHA512:
6
- metadata.gz: 30bf47ea7e3bb6baf8e52adc60ca7d8d2ef5ee532dd3effe9ae0994d017ee43bce26ff4035901b329fd2865cf9d6f35fb6e5c92515e7afb536f5d471eb91640f
7
- data.tar.gz: 19a9a15800568b21b583a690c0a3d56dd40841c15369971afd83d38e54b5f1e2752727eb6027b4a9ef42c84317af455c95530216cddd1221dc1c9e38fa226e1c
6
+ metadata.gz: f816d3cef57c6527ceae6e7dea24ec1ffd99f097ba97a8292ae1db20e3718d417f12661471830806038d0a2018deb9844c5dc57513c0c2482c1501795edfc605
7
+ data.tar.gz: 9304d8711e83748d065f9ab1eddca0528b97f11d84aaec870726d6907c51343898da7656983d402e0c6ec723b41e5246bb504896332008ba0a304bc153bd27e9
@@ -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 = (@ssid += 1)
268
- sub = @subs[sid] = Subscription.new
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
 
@@ -1,7 +1,7 @@
1
1
  module NATS
2
2
  module IO
3
3
  # NOTE: These are all announced to the server on CONNECT
4
- VERSION = "0.2.2"
4
+ VERSION = "0.2.4"
5
5
  LANG = "#{RUBY_ENGINE}2".freeze
6
6
  PROTOCOL = 1
7
7
  end
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.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-14 00:00:00.000000000 Z
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.6.8
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.