shoryuken 3.3.0 → 3.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +5 -0
- data/lib/shoryuken/queue.rb +4 -1
- data/lib/shoryuken/version.rb +1 -1
- data/spec/shoryuken/queue_spec.rb +19 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 52e12e226493b5e6bd3b03fe20e72704be91e0a3
|
4
|
+
data.tar.gz: 01307631f8faa8eaec721440afd52ce5fabde0b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9d451c4a642436008d1cdf60edd78d8e251fa56cc8ddc455792a85a997eb2acc601ff8a7743f3bfb5cfeadac5c8a9059490df63b5a2ec1dae3174eb4f868fd5
|
7
|
+
data.tar.gz: 9da2205a92ff6f92ce6befc0c61de49aa174529d5b704329341dd47e4aaa0a48288678d729c6b3f32695a46560136c5cfc230e7204316d6b9c759972a7a14d36
|
data/CHANGELOG.md
CHANGED
data/lib/shoryuken/queue.rb
CHANGED
@@ -44,7 +44,10 @@ module Shoryuken
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def fifo?
|
47
|
-
|
47
|
+
# Make sure the memoization work with boolean to avoid multiple calls to SQS
|
48
|
+
# see https://github.com/phstc/shoryuken/pull/529
|
49
|
+
return @_fifo if defined?(@_fifo)
|
50
|
+
@_fifo = queue_attributes.attributes[FIFO_ATTR] == 'true'
|
48
51
|
end
|
49
52
|
|
50
53
|
private
|
data/lib/shoryuken/version.rb
CHANGED
@@ -193,9 +193,8 @@ RSpec.describe Shoryuken::Queue do
|
|
193
193
|
end
|
194
194
|
|
195
195
|
describe '#fifo?' do
|
196
|
+
let(:attribute_response) { double 'Aws::SQS::Types::GetQueueAttributesResponse' }
|
196
197
|
before do
|
197
|
-
attribute_response = double 'Aws::SQS::Types::GetQueueAttributesResponse'
|
198
|
-
|
199
198
|
allow(attribute_response).to(
|
200
199
|
receive(:attributes).and_return('FifoQueue' => fifo.to_s, 'ContentBasedDeduplication' => 'true')
|
201
200
|
)
|
@@ -209,12 +208,30 @@ RSpec.describe Shoryuken::Queue do
|
|
209
208
|
let(:fifo) { true }
|
210
209
|
|
211
210
|
specify { expect(subject.fifo?).to be }
|
211
|
+
|
212
|
+
it 'memoizes response' do
|
213
|
+
expect(sqs).to(
|
214
|
+
receive(:get_queue_attributes).with(queue_url: queue_url, attribute_names: ['All']).and_return(attribute_response)
|
215
|
+
).exactly(1).times
|
216
|
+
|
217
|
+
subject.fifo?
|
218
|
+
subject.fifo?
|
219
|
+
end
|
212
220
|
end
|
213
221
|
|
214
222
|
context 'when queue is not FIFO' do
|
215
223
|
let(:fifo) { false }
|
216
224
|
|
217
225
|
specify { expect(subject.fifo?).to_not be }
|
226
|
+
|
227
|
+
it 'memoizes response' do
|
228
|
+
expect(sqs).to(
|
229
|
+
receive(:get_queue_attributes).with(queue_url: queue_url, attribute_names: ['All']).and_return(attribute_response)
|
230
|
+
).exactly(1).times
|
231
|
+
|
232
|
+
subject.fifo?
|
233
|
+
subject.fifo?
|
234
|
+
end
|
218
235
|
end
|
219
236
|
end
|
220
237
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shoryuken
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3.
|
4
|
+
version: 3.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pablo Cantero
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -228,7 +228,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
228
228
|
version: '0'
|
229
229
|
requirements: []
|
230
230
|
rubyforge_project:
|
231
|
-
rubygems_version: 2.
|
231
|
+
rubygems_version: 2.5.2
|
232
232
|
signing_key:
|
233
233
|
specification_version: 4
|
234
234
|
summary: Shoryuken is a super efficient AWS SQS thread based message processor
|