protobuf-nats 0.2.0 → 0.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eeff2a5c3d939012fe3cd2cb7cce12ba89392a81
4
- data.tar.gz: 406a4b1f779d1a3d91ea136bbb3616560e8152a7
3
+ metadata.gz: 6b4f7a7217fe39c0e3aa4b20064c3afc20bcebff
4
+ data.tar.gz: e6704320debc2d5241fb6a0306941a06ab44b45d
5
5
  SHA512:
6
- metadata.gz: 8a517022291c46d42a4c6b243cc50625ca37770e64c3fb387c990b43d06b70078ab697a2b153b1e731f04d622758c4a7a33915267014f0f47440e238f3d1455e
7
- data.tar.gz: 2368ebed1aead198a600eebac3cdea821c4004737a9983e549b217025fb7d1d10c4a3bed46523b189b1920bb872af2e462acf61d00b07f07c1f264292bd433cb
6
+ metadata.gz: f0d85a49668fea2402f44661d834b5b75284499801e245224c80c5ab528c2e9ef7771d2a5e5aadef88a5dab1c20e85e2d583fa6fecf3d3b8594bbc77a09068f7
7
+ data.tar.gz: 16e27c6bf470214dac9c403af3849b942501edccb675a13cb606b4014da47053908d65a86aad5dca1aa516862ffd6d588cce1c9fd63cb590397015e2d2291087
data/lib/protobuf/nats.rb CHANGED
@@ -50,7 +50,8 @@ module Protobuf
50
50
  def self.start_client_nats_connection
51
51
  @start_client_nats_connection ||= begin
52
52
  GET_CONNECTED_MUTEX.synchronize do
53
- return if @start_client_nats_connection
53
+ break true if @client_nats_connection
54
+ break true if @start_client_nats_connection
54
55
 
55
56
  @client_nats_connection = NatsClient.new
56
57
  @client_nats_connection.connect(config.connection_options)
@@ -84,7 +84,7 @@ module Protobuf
84
84
  end
85
85
 
86
86
  success = has_ack && response
87
- fail ::NATS::IO::Timeout unless success
87
+ fail(::NATS::IO::Timeout, subject) unless success
88
88
 
89
89
  response
90
90
  ensure
@@ -67,8 +67,11 @@ module Protobuf
67
67
  # Do not depend on #close for a greaceful disconnect.
68
68
  def close
69
69
  @connection.close
70
+ @connection = nil
70
71
  @supervisor.kill rescue nil
72
+ @supervisor = nil
71
73
  @consumer.kill rescue nil
74
+ @supervisor = nil
72
75
  end
73
76
 
74
77
  def flush(timeout_sec = 0.5)
@@ -1,5 +1,5 @@
1
1
  module Protobuf
2
2
  module Nats
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
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.2.0
4
+ version: 0.2.1
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-04-10 00:00:00.000000000 Z
11
+ date: 2017-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: protobuf