shoryuken 3.1.0 → 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/shoryuken/manager.rb +3 -3
- data/lib/shoryuken/version.rb +1 -1
- data/spec/shoryuken/manager_spec.rb +26 -10
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e3626c435f7da14e0880fabb7faf65e397aa82e0
|
4
|
+
data.tar.gz: 37461e552bc0566e3edd7a79a9dbbe92bbdbb5a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a0b1138fcfaf8453e9ae9770dd8f70f4d5db75b81c5b66d5ca740cc92eefd585c7c396bce94a6401527c4465a5d8aa3bdfcfa00ab001567491a45c564e0d993
|
7
|
+
data.tar.gz: 64dfb7449d054cdee861632ca32cf09f47215f400b81025ae5d2481dbcc0ab062e780c6b9a47e23ffb0ae3bf697924b965b7a8e048a7b866535d5dc92021e6c0
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## [v3.1.1] - 2017-07-02
|
2
|
+
|
3
|
+
- Reduce log verbosity introduced in 3.1.0
|
4
|
+
- [#397](https://github.com/phstc/shoryuken/pull/397)
|
5
|
+
|
6
|
+
- Try to prevent stack level too deep on Ubuntu
|
7
|
+
- [#396](https://github.com/phstc/shoryuken/pull/396)
|
8
|
+
|
1
9
|
## [v3.1.0] - 2017-07-02
|
2
10
|
|
3
11
|
- Add shoryuken sqs delete command
|
data/lib/shoryuken/manager.rb
CHANGED
@@ -25,19 +25,19 @@ module Shoryuken
|
|
25
25
|
private
|
26
26
|
|
27
27
|
def stopped?
|
28
|
-
@done.true?
|
28
|
+
@done.true?
|
29
29
|
end
|
30
30
|
|
31
31
|
def dispatch
|
32
32
|
return if stopped?
|
33
33
|
|
34
|
-
if
|
34
|
+
if ready <= 0 || (queue = @polling_strategy.next_queue).nil?
|
35
35
|
return dispatch_later
|
36
36
|
end
|
37
37
|
|
38
38
|
fire_event(:dispatch)
|
39
39
|
|
40
|
-
logger.
|
40
|
+
logger.debug { "Ready: #{ready}, Busy: #{busy}, Active Queues: #{@polling_strategy.active_queues}" }
|
41
41
|
|
42
42
|
batched_queue?(queue) ? dispatch_batch(queue) : dispatch_single_messages(queue)
|
43
43
|
|
data/lib/shoryuken/version.rb
CHANGED
@@ -25,31 +25,47 @@ RSpec.describe Shoryuken::Manager do
|
|
25
25
|
TestWorker.get_shoryuken_options['batch'] = false
|
26
26
|
end
|
27
27
|
|
28
|
+
describe '#stop' do
|
29
|
+
specify do
|
30
|
+
allow(subject).to receive(:stopped?).and_return(false, false, true)
|
31
|
+
expect(subject).to receive(:dispatch).thrice.and_call_original
|
32
|
+
expect(subject).to receive(:dispatch_later).once.and_call_original
|
33
|
+
subject.start
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
28
37
|
describe '#start' do
|
29
|
-
|
38
|
+
before do
|
39
|
+
# prevent dispatch loop
|
40
|
+
allow(subject).to receive(:stopped?).and_return(false, true)
|
41
|
+
end
|
42
|
+
|
43
|
+
it 'pauses when there are no active queues' do
|
30
44
|
expect(polling_strategy).to receive(:next_queue).and_return(nil)
|
31
|
-
|
45
|
+
expect(subject).to receive(:dispatch_later)
|
32
46
|
subject.start
|
33
47
|
end
|
34
48
|
|
35
|
-
|
49
|
+
it 'calls dispatch_batch if worker wants batches' do
|
36
50
|
TestWorker.get_shoryuken_options['batch'] = true
|
37
|
-
|
38
|
-
expect(subject).to receive(:dispatch_later)
|
51
|
+
expect(subject).to receive(:dispatch_batch).with(queue_config_of(queue))
|
39
52
|
subject.start
|
40
53
|
end
|
41
54
|
|
42
|
-
|
43
|
-
|
44
|
-
with(queue_config_of(queue))
|
45
|
-
expect(subject).to receive(:dispatch_later)
|
55
|
+
it 'calls dispatch_single_messages if worker wants single messages' do
|
56
|
+
expect(subject).to receive(:dispatch_single_messages).with(queue_config_of(queue))
|
46
57
|
subject.start
|
47
58
|
end
|
48
59
|
end
|
49
60
|
|
50
61
|
describe '#dispatch' do
|
51
|
-
|
62
|
+
it 'fires a dispatch event' do
|
63
|
+
# prevent dispatch loop
|
64
|
+
allow(subject).to receive(:stopped?).and_return(false, true)
|
65
|
+
|
52
66
|
expect(subject).to receive(:fire_event).with(:dispatch)
|
67
|
+
expect(Shoryuken.logger).to_not receive(:info)
|
68
|
+
|
53
69
|
subject.send(:dispatch)
|
54
70
|
end
|
55
71
|
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.1.
|
4
|
+
version: 3.1.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: 2017-07-
|
11
|
+
date: 2017-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|