fastly_nsq 0.12.0 → 0.12.1

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: ec5180b8b65ede93fdbb509c673c8bb539f9010e
4
- data.tar.gz: 58705d4fe6bd3fb791803f393db63fb53b57c3ae
3
+ metadata.gz: 64261464e7b2c73f8de59ff0a463addef794753a
4
+ data.tar.gz: 3c85eb1c230574998ec0bc44a6464d03a675092c
5
5
  SHA512:
6
- metadata.gz: 787a47a30094daac20acc0db56e9a257716be62f2a212df288fa2c488646508bc49fd8589d034b661bbdf38183ddba1ad627c10967796a63cbeb29f8fc3c66de
7
- data.tar.gz: c0cfe65d8a15bca78def1d826f98ce4d632f6b09a581298e37ebfa8e4a3fca94d2e2b5b12473015291c881886e3ffa8cab442d1276d8620c755e7b1d06d59b8a
6
+ metadata.gz: 5dfb3407af2c44573556685180ae4917d10e0ed8b9a3d3be708da136833ae16d9733493a3b4bc1282a86dee3f0d3883082eed2f9e8a0593a37193650401fee0b
7
+ data.tar.gz: 44bb68a265f7e685c52c21408b9eba9c3a1a555b9ea291a057b946628db62ab08af51270d104fbc782a5a074e13fd6f9b4809d64546dca17bf0fa424c076d0e2
@@ -61,8 +61,6 @@ module FastlyNsq
61
61
  rescue Exception => ex # rubocop:disable Lint/RescueException
62
62
  @logger.error ex.inspect
63
63
  @manager.listener_killed(self)
64
- ensure
65
- cleanup
66
64
  end
67
65
 
68
66
  def status
@@ -71,12 +69,14 @@ module FastlyNsq
71
69
 
72
70
  def terminate
73
71
  @done = true
72
+ cleanup
74
73
  return unless @thread
75
74
  @logger.info "< Listener TERM: topic #{@topic}"
76
75
  end
77
76
 
78
77
  def kill
79
78
  @done = true
79
+ cleanup
80
80
  return unless @thread
81
81
  @logger.info "< Listener KILL: topic #{@topic}"
82
82
  @thread.raise FastlyNsq::Shutdown
@@ -90,7 +90,7 @@ module FastlyNsq
90
90
 
91
91
  def cleanup
92
92
  @consumer.terminate
93
- @logger.info '< Consumer terminated'
93
+ @logger.info "< Consumer terminated: topic [#{@topic}]"
94
94
  end
95
95
 
96
96
  def next_message
@@ -1,3 +1,3 @@
1
1
  module FastlyNsq
2
- VERSION = '0.12.0'.freeze
2
+ VERSION = '0.12.1'.freeze
3
3
  end
@@ -168,10 +168,13 @@ RSpec.describe FastlyNsq::Listener do
168
168
  listener.start
169
169
  state = listener.instance_variable_get(:@done)
170
170
  expect(state).to eq false
171
+ consumer = listener.instance_variable_get(:@consumer)
172
+ allow(consumer).to receive(:terminate)
171
173
  listener.terminate
172
174
 
173
175
  state = listener.instance_variable_get(:@done)
174
- expect(logger).to have_received(:info).twice
176
+ expect(logger).to have_received(:info).thrice
177
+ expect(consumer).to have_received(:terminate)
175
178
  expect(state).to eq true
176
179
  end
177
180
 
@@ -179,10 +182,13 @@ RSpec.describe FastlyNsq::Listener do
179
182
  listener.start
180
183
  state = listener.instance_variable_get(:@done)
181
184
  expect(state).to eq false
185
+ consumer = listener.instance_variable_get(:@consumer)
186
+ allow(consumer).to receive(:terminate)
182
187
  listener.kill
183
188
 
184
189
  state = listener.instance_variable_get(:@done)
185
- expect(logger).to have_received(:info).twice
190
+ expect(logger).to have_received(:info).thrice
191
+ expect(consumer).to have_received(:terminate)
186
192
  expect(thread).to have_received(:raise).with(FastlyNsq::Shutdown)
187
193
  expect(state).to eq true
188
194
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastly_nsq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tommy O'Neil
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2017-08-22 00:00:00.000000000 Z
14
+ date: 2017-09-06 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: awesome_print