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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 779c3e9c7f708f0a6dccb3e8b0c9f7e2490b25e1
4
- data.tar.gz: bf260a2793ff8c07ddfb670832ba5f12af8d85d9
3
+ metadata.gz: e3626c435f7da14e0880fabb7faf65e397aa82e0
4
+ data.tar.gz: 37461e552bc0566e3edd7a79a9dbbe92bbdbb5a2
5
5
  SHA512:
6
- metadata.gz: 1f3e7a4b668c929daa1b5424b7a8ab7f028238b3f6dfe0e812351991bbc37923b58491760df6e4ed4921624cd4954761daeac257c6a540fd193d160d121044de
7
- data.tar.gz: 02f2bf2e813cbe1624ae83d16936196ecf523fe8d3773f9b0c39813aa0822d3c71fd273ee01a63072c20d86bf05f4c1a775eda3fae41cec4bf55ea567f772aef
6
+ metadata.gz: 2a0b1138fcfaf8453e9ae9770dd8f70f4d5db75b81c5b66d5ca740cc92eefd585c7c396bce94a6401527c4465a5d8aa3bdfcfa00ab001567491a45c564e0d993
7
+ data.tar.gz: 64dfb7449d054cdee861632ca32cf09f47215f400b81025ae5d2481dbcc0ab062e780c6b9a47e23ffb0ae3bf697924b965b7a8e048a7b866535d5dc92021e6c0
@@ -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
@@ -25,19 +25,19 @@ module Shoryuken
25
25
  private
26
26
 
27
27
  def stopped?
28
- @done.true? || !Concurrent.global_io_executor.running?
28
+ @done.true?
29
29
  end
30
30
 
31
31
  def dispatch
32
32
  return if stopped?
33
33
 
34
- if !ready.positive? || (queue = @polling_strategy.next_queue).nil?
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.info { "Ready: #{ready}, Busy: #{busy}, Active Queues: #{@polling_strategy.active_queues}" }
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
 
@@ -1,3 +1,3 @@
1
1
  module Shoryuken
2
- VERSION = '3.1.0'.freeze
2
+ VERSION = '3.1.1'.freeze
3
3
  end
@@ -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
- xit 'pauses when there are no active queues' do
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
- expect_any_instance_of(described_class).to receive(:after)
45
+ expect(subject).to receive(:dispatch_later)
32
46
  subject.start
33
47
  end
34
48
 
35
- xit 'calls dispatch_batch if worker wants batches' do
49
+ it 'calls dispatch_batch if worker wants batches' do
36
50
  TestWorker.get_shoryuken_options['batch'] = true
37
- expect_any_instance_of(described_class).to receive(:dispatch_batch).with(queue_config_of(queue))
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
- xit 'calls dispatch_single_messages if worker wants single messages' do
43
- expect_any_instance_of(described_class).to receive(:dispatch_single_messages).
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
- xit 'fires a dispatch event' do
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.0
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-03 00:00:00.000000000 Z
11
+ date: 2017-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler