shoryuken 5.2.3 → 6.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 +4 -4
- data/.devcontainer/Dockerfile +17 -0
- data/.devcontainer/base.Dockerfile +43 -0
- data/.devcontainer/devcontainer.json +35 -0
- data/.github/dependabot.yml +6 -0
- data/.github/workflows/specs.yml +5 -2
- data/.github/workflows/stale.yml +20 -0
- data/.gitignore +1 -1
- data/.rubocop.yml +1 -1
- data/Appraisals +6 -0
- data/CHANGELOG.md +152 -0
- data/Gemfile +6 -3
- data/README.md +19 -1
- data/bin/cli/sqs.rb +1 -1
- data/gemfiles/aws_sdk_core_2.gemfile +1 -1
- data/gemfiles/rails_7_0.gemfile +22 -0
- data/lib/shoryuken/default_exception_handler.rb +10 -0
- data/lib/shoryuken/environment_loader.rb +22 -3
- data/lib/shoryuken/extensions/active_job_adapter.rb +5 -2
- data/lib/shoryuken/extensions/active_job_extensions.rb +1 -1
- data/lib/shoryuken/launcher.rb +25 -3
- data/lib/shoryuken/logging.rb +2 -2
- data/lib/shoryuken/manager.rb +27 -10
- data/lib/shoryuken/message.rb +11 -28
- data/lib/shoryuken/middleware/server/active_record.rb +5 -1
- data/lib/shoryuken/options.rb +14 -6
- data/lib/shoryuken/polling/strict_priority.rb +4 -2
- data/lib/shoryuken/polling/weighted_round_robin.rb +3 -5
- data/lib/shoryuken/processor.rb +14 -6
- data/lib/shoryuken/queue.rb +5 -3
- data/lib/shoryuken/runner.rb +4 -3
- data/lib/shoryuken/version.rb +1 -1
- data/lib/shoryuken.rb +11 -0
- data/shoryuken.gemspec +1 -1
- data/spec/shared_examples_for_active_job.rb +4 -2
- data/spec/shoryuken/default_exception_handler_spec.rb +71 -0
- data/spec/shoryuken/environment_loader_spec.rb +42 -9
- data/spec/shoryuken/extensions/active_job_base_spec.rb +1 -1
- data/spec/shoryuken/fetcher_spec.rb +12 -12
- data/spec/shoryuken/launcher_spec.rb +105 -0
- data/spec/shoryuken/manager_spec.rb +32 -6
- data/spec/shoryuken/polling/weighted_round_robin_spec.rb +31 -6
- data/spec/shoryuken/processor_spec.rb +38 -0
- data/spec/shoryuken/queue_spec.rb +10 -5
- data/spec/shoryuken/util_spec.rb +24 -4
- data/spec/shoryuken/worker/default_executor_spec.rb +48 -48
- data/spec/shoryuken_spec.rb +9 -0
- data/spec/spec_helper.rb +2 -0
- metadata +18 -7
@@ -10,16 +10,16 @@ RSpec.describe Shoryuken::Worker::DefaultExecutor do
|
|
10
10
|
|
11
11
|
describe '.perform_in' do
|
12
12
|
it 'delays a message' do
|
13
|
-
expect(sqs_queue).to receive(:send_message).with(
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
13
|
+
expect(sqs_queue).to receive(:send_message).with({
|
14
|
+
message_attributes: {
|
15
|
+
'shoryuken_class' => {
|
16
|
+
string_value: TestWorker.to_s,
|
17
|
+
data_type: 'String'
|
18
|
+
}
|
19
|
+
},
|
20
|
+
message_body: 'message',
|
21
|
+
delay_seconds: 60
|
22
|
+
})
|
23
23
|
|
24
24
|
TestWorker.perform_in(60, 'message')
|
25
25
|
end
|
@@ -33,16 +33,16 @@ RSpec.describe Shoryuken::Worker::DefaultExecutor do
|
|
33
33
|
|
34
34
|
describe '.perform_at' do
|
35
35
|
it 'delays a message' do
|
36
|
-
expect(sqs_queue).to receive(:send_message).with(
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
36
|
+
expect(sqs_queue).to receive(:send_message).with({
|
37
|
+
message_attributes: {
|
38
|
+
'shoryuken_class' => {
|
39
|
+
string_value: TestWorker.to_s,
|
40
|
+
data_type: 'String'
|
41
|
+
}
|
42
|
+
},
|
43
|
+
message_body: 'message',
|
44
|
+
delay_seconds: 60
|
45
|
+
})
|
46
46
|
|
47
47
|
TestWorker.perform_in(Time.now + 60, 'message')
|
48
48
|
end
|
@@ -56,30 +56,30 @@ RSpec.describe Shoryuken::Worker::DefaultExecutor do
|
|
56
56
|
|
57
57
|
describe '.perform_async' do
|
58
58
|
it 'enqueues a message' do
|
59
|
-
expect(sqs_queue).to receive(:send_message).with(
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
59
|
+
expect(sqs_queue).to receive(:send_message).with({
|
60
|
+
message_attributes: {
|
61
|
+
'shoryuken_class' => {
|
62
|
+
string_value: TestWorker.to_s,
|
63
|
+
data_type: 'String'
|
64
|
+
}
|
65
|
+
},
|
66
|
+
message_body: 'message'
|
67
|
+
})
|
68
68
|
|
69
69
|
TestWorker.perform_async('message')
|
70
70
|
end
|
71
71
|
|
72
72
|
it 'enqueues a message with options' do
|
73
|
-
expect(sqs_queue).to receive(:send_message).with(
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
73
|
+
expect(sqs_queue).to receive(:send_message).with({
|
74
|
+
delay_seconds: 60,
|
75
|
+
message_attributes: {
|
76
|
+
'shoryuken_class' => {
|
77
|
+
string_value: TestWorker.to_s,
|
78
|
+
data_type: 'String'
|
79
|
+
}
|
80
|
+
},
|
81
|
+
message_body: 'delayed message'
|
82
|
+
})
|
83
83
|
|
84
84
|
TestWorker.perform_async('delayed message', delay_seconds: 60)
|
85
85
|
end
|
@@ -89,15 +89,15 @@ RSpec.describe Shoryuken::Worker::DefaultExecutor do
|
|
89
89
|
|
90
90
|
expect(Shoryuken::Client).to receive(:queues).with(new_queue).and_return(sqs_queue)
|
91
91
|
|
92
|
-
expect(sqs_queue).to receive(:send_message).with(
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
92
|
+
expect(sqs_queue).to receive(:send_message).with({
|
93
|
+
message_attributes: {
|
94
|
+
'shoryuken_class' => {
|
95
|
+
string_value: TestWorker.to_s,
|
96
|
+
data_type: 'String'
|
97
|
+
}
|
98
|
+
},
|
99
|
+
message_body: 'delayed message'
|
100
|
+
})
|
101
101
|
|
102
102
|
TestWorker.perform_async('delayed message', queue: new_queue)
|
103
103
|
end
|
data/spec/shoryuken_spec.rb
CHANGED
@@ -1,4 +1,13 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
RSpec.describe Shoryuken do
|
4
|
+
describe '.healthy?' do
|
5
|
+
before do
|
6
|
+
allow(Shoryuken::Runner).to receive(:instance).and_return(double(:instance, healthy?: :some_result))
|
7
|
+
end
|
8
|
+
|
9
|
+
it 'delegates to the runner instance' do
|
10
|
+
expect(described_class.healthy?).to eq(:some_result)
|
11
|
+
end
|
12
|
+
end
|
4
13
|
end
|
data/spec/spec_helper.rb
CHANGED
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:
|
4
|
+
version: 6.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pablo Cantero
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dotenv
|
@@ -103,8 +103,13 @@ extensions: []
|
|
103
103
|
extra_rdoc_files: []
|
104
104
|
files:
|
105
105
|
- ".codeclimate.yml"
|
106
|
+
- ".devcontainer/Dockerfile"
|
107
|
+
- ".devcontainer/base.Dockerfile"
|
108
|
+
- ".devcontainer/devcontainer.json"
|
106
109
|
- ".github/FUNDING.yml"
|
110
|
+
- ".github/dependabot.yml"
|
107
111
|
- ".github/workflows/specs.yml"
|
112
|
+
- ".github/workflows/stale.yml"
|
108
113
|
- ".gitignore"
|
109
114
|
- ".reek.yml"
|
110
115
|
- ".rspec"
|
@@ -126,10 +131,12 @@ files:
|
|
126
131
|
- gemfiles/rails_5_2.gemfile
|
127
132
|
- gemfiles/rails_6_0.gemfile
|
128
133
|
- gemfiles/rails_6_1.gemfile
|
134
|
+
- gemfiles/rails_7_0.gemfile
|
129
135
|
- lib/shoryuken.rb
|
130
136
|
- lib/shoryuken/body_parser.rb
|
131
137
|
- lib/shoryuken/client.rb
|
132
138
|
- lib/shoryuken/core_ext.rb
|
139
|
+
- lib/shoryuken/default_exception_handler.rb
|
133
140
|
- lib/shoryuken/default_worker_registry.rb
|
134
141
|
- lib/shoryuken/environment_loader.rb
|
135
142
|
- lib/shoryuken/extensions/active_job_adapter.rb
|
@@ -167,6 +174,7 @@ files:
|
|
167
174
|
- spec/shoryuken/body_parser_spec.rb
|
168
175
|
- spec/shoryuken/client_spec.rb
|
169
176
|
- spec/shoryuken/core_ext_spec.rb
|
177
|
+
- spec/shoryuken/default_exception_handler_spec.rb
|
170
178
|
- spec/shoryuken/default_worker_registry_spec.rb
|
171
179
|
- spec/shoryuken/environment_loader_spec.rb
|
172
180
|
- spec/shoryuken/extensions/active_job_adapter_spec.rb
|
@@ -174,6 +182,7 @@ files:
|
|
174
182
|
- spec/shoryuken/extensions/active_job_concurrent_send_adapter_spec.rb
|
175
183
|
- spec/shoryuken/extensions/active_job_wrapper_spec.rb
|
176
184
|
- spec/shoryuken/fetcher_spec.rb
|
185
|
+
- spec/shoryuken/launcher_spec.rb
|
177
186
|
- spec/shoryuken/manager_spec.rb
|
178
187
|
- spec/shoryuken/middleware/chain_spec.rb
|
179
188
|
- spec/shoryuken/middleware/server/auto_delete_spec.rb
|
@@ -194,11 +203,11 @@ files:
|
|
194
203
|
- spec/spec_helper.rb
|
195
204
|
- test_workers/endless_interruptive_worker.rb
|
196
205
|
- test_workers/endless_uninterruptive_worker.rb
|
197
|
-
homepage: https://github.com/
|
206
|
+
homepage: https://github.com/ruby-shoryuken/shoryuken
|
198
207
|
licenses:
|
199
208
|
- LGPL-3.0
|
200
209
|
metadata: {}
|
201
|
-
post_install_message:
|
210
|
+
post_install_message:
|
202
211
|
rdoc_options: []
|
203
212
|
require_paths:
|
204
213
|
- lib
|
@@ -213,8 +222,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
213
222
|
- !ruby/object:Gem::Version
|
214
223
|
version: '0'
|
215
224
|
requirements: []
|
216
|
-
rubygems_version: 3.
|
217
|
-
signing_key:
|
225
|
+
rubygems_version: 3.3.26
|
226
|
+
signing_key:
|
218
227
|
specification_version: 4
|
219
228
|
summary: Shoryuken is a super efficient AWS SQS thread based message processor
|
220
229
|
test_files:
|
@@ -224,6 +233,7 @@ test_files:
|
|
224
233
|
- spec/shoryuken/body_parser_spec.rb
|
225
234
|
- spec/shoryuken/client_spec.rb
|
226
235
|
- spec/shoryuken/core_ext_spec.rb
|
236
|
+
- spec/shoryuken/default_exception_handler_spec.rb
|
227
237
|
- spec/shoryuken/default_worker_registry_spec.rb
|
228
238
|
- spec/shoryuken/environment_loader_spec.rb
|
229
239
|
- spec/shoryuken/extensions/active_job_adapter_spec.rb
|
@@ -231,6 +241,7 @@ test_files:
|
|
231
241
|
- spec/shoryuken/extensions/active_job_concurrent_send_adapter_spec.rb
|
232
242
|
- spec/shoryuken/extensions/active_job_wrapper_spec.rb
|
233
243
|
- spec/shoryuken/fetcher_spec.rb
|
244
|
+
- spec/shoryuken/launcher_spec.rb
|
234
245
|
- spec/shoryuken/manager_spec.rb
|
235
246
|
- spec/shoryuken/middleware/chain_spec.rb
|
236
247
|
- spec/shoryuken/middleware/server/auto_delete_spec.rb
|