sidekiq-throttled 0.14.1 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +6 -9
- data/.rubocop.yml +1 -1
- data/Appraisals +8 -0
- data/CHANGES.md +33 -0
- data/LICENSE.md +1 -0
- data/README.md +4 -1
- data/gemfiles/sidekiq_5.0.gemfile +3 -3
- data/gemfiles/sidekiq_5.1.gemfile +3 -3
- data/gemfiles/sidekiq_5.2.gemfile +3 -3
- data/gemfiles/sidekiq_6.0.gemfile +3 -3
- data/gemfiles/sidekiq_6.1.gemfile +3 -3
- data/gemfiles/sidekiq_6.2.gemfile +31 -0
- data/gemfiles/sidekiq_6.3.gemfile +31 -0
- data/lib/sidekiq/throttled/communicator/callbacks.rb +4 -6
- data/lib/sidekiq/throttled/strategy_collection.rb +2 -3
- data/lib/sidekiq/throttled/version.rb +1 -1
- data/sidekiq-throttled.gemspec +2 -2
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6dcc92c4940527e645d6a211b068094aef5c1f1cb103ad07d74b9b42132eb80
|
4
|
+
data.tar.gz: c2a8b341bfc9586a97f5f918b19bcf0e35ec4c93b5e2955802d26e5846cb7351
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d587a45dcf488a6ff722082c3ddf27c52bf19f4575fab922789580f36bae4031fe8f20d6825e0490d253f6f36f52a5c026b78bcd8b72de919fe094130c48c609
|
7
|
+
data.tar.gz: cdf97140a7cc3bc78720f59acd629d54ea4fbca2d5a3b8696cb92695b1b73d7b070dc7074a4278af6562a01987eeee3e7ce57c5405b5d23b0fb54afdd04458d3
|
data/.github/workflows/ci.yml
CHANGED
@@ -11,9 +11,10 @@ jobs:
|
|
11
11
|
name: "rspec (ruby:${{ matrix.ruby }} sidekiq:${{ matrix.sidekiq }})"
|
12
12
|
|
13
13
|
strategy:
|
14
|
+
fail-fast: false
|
14
15
|
matrix:
|
15
|
-
ruby: [ "2.6", "2.7" ]
|
16
|
-
sidekiq: [ "5.0", "5.1", "5.2", "6.0", "6.1" ]
|
16
|
+
ruby: [ "2.6", "2.7", "3.0" ]
|
17
|
+
sidekiq: [ "5.0", "5.1", "5.2", "6.0", "6.1", "6.2", "6.3" ]
|
17
18
|
|
18
19
|
runs-on: ubuntu-latest
|
19
20
|
|
@@ -32,9 +33,7 @@ jobs:
|
|
32
33
|
- uses: ruby/setup-ruby@v1
|
33
34
|
with:
|
34
35
|
ruby-version: ${{ matrix.ruby }}
|
35
|
-
|
36
|
-
- name: bundle install
|
37
|
-
run: bundle install --without development --jobs 4 --retry 3
|
36
|
+
bundler-cache: true
|
38
37
|
|
39
38
|
- run: bundle exec rspec
|
40
39
|
|
@@ -46,9 +45,7 @@ jobs:
|
|
46
45
|
|
47
46
|
- uses: ruby/setup-ruby@v1
|
48
47
|
with:
|
49
|
-
ruby-version: "2.
|
50
|
-
|
51
|
-
- name: bundle install
|
52
|
-
run: bundle install --without development --jobs 4 --retry 3
|
48
|
+
ruby-version: "2.6"
|
49
|
+
bundler-cache: true
|
53
50
|
|
54
51
|
- run: bundle exec rubocop
|
data/.rubocop.yml
CHANGED
data/Appraisals
CHANGED
data/CHANGES.md
CHANGED
@@ -1,3 +1,29 @@
|
|
1
|
+
## 0.15.0 (2021-12-16)
|
2
|
+
|
3
|
+
* [#102](https://github.com/sensortower/sidekiq-throttled/pull/102)
|
4
|
+
Support Ruby 3.0 and Sidekiq 6.2+.
|
5
|
+
([@ybiquitous])
|
6
|
+
|
7
|
+
* [#97](https://github.com/sensortower/sidekiq-throttled/pull/97)
|
8
|
+
Fix kwargs usage in strategy collection.
|
9
|
+
([@baptistejub])
|
10
|
+
|
11
|
+
## 0.14.0 (2021-09-21)
|
12
|
+
|
13
|
+
* [#98](https://github.com/sensortower/sidekiq-throttled/pull/98)
|
14
|
+
Remove warning for strategy override.
|
15
|
+
([@mattiagiuffrida-st])
|
16
|
+
|
17
|
+
* [#65](https://github.com/sensortower/sidekiq-throttled/pull/65)
|
18
|
+
Support composite (multi-key) strategies.
|
19
|
+
([@holyketzer])
|
20
|
+
|
21
|
+
* [#89](https://github.com/sensortower/sidekiq-throttled/pull/89),
|
22
|
+
[#96](https://github.com/sensortower/sidekiq-throttled/pull/96), and
|
23
|
+
[#93](https://github.com/sensortower/sidekiq-throttled/pull/93)
|
24
|
+
Improve documentation.
|
25
|
+
([@hubertjakubiak], [@khaile], and [@kylerippey])
|
26
|
+
|
1
27
|
## 0.13.0 (2020-07-28)
|
2
28
|
|
3
29
|
* [#85](https://github.com/sensortower/sidekiq-throttled/pull/85)
|
@@ -221,3 +247,10 @@
|
|
221
247
|
[@lenon]: https://github.com/lenon
|
222
248
|
[@vaot]: https://github.com/vaot
|
223
249
|
[@hmaack]: https://github.com/hmaack
|
250
|
+
[@holyketzer]: https://github.com/holyketzer
|
251
|
+
[@hubertjakubiak]: https://github.com/hubertjakubiak
|
252
|
+
[@kylerippey]: https://github.com/kylerippey
|
253
|
+
[@khaile]: https://github.com/khaile
|
254
|
+
[@mattiagiuffrida-st]: https://github.com/mattiagiuffrida-st
|
255
|
+
[@baptistejub]: https://github.com/baptistejub
|
256
|
+
[@ybiquitous]: https://github.com/ybiquitous
|
data/LICENSE.md
CHANGED
data/README.md
CHANGED
@@ -235,6 +235,7 @@ versions:
|
|
235
235
|
|
236
236
|
* Ruby 2.6.x
|
237
237
|
* Ruby 2.7.x
|
238
|
+
* Ruby 3.0.x
|
238
239
|
|
239
240
|
If something doesn't work on one of these versions, it's a bug.
|
240
241
|
|
@@ -259,6 +260,8 @@ This library aims to support work with following [Sidekiq][sidekiq] versions:
|
|
259
260
|
* Sidekiq 5.2.x
|
260
261
|
* Sidekiq 6.0.x
|
261
262
|
* Sidekiq 6.1.x
|
263
|
+
* Sidekiq 6.2.x
|
264
|
+
* Sidekiq 6.3.x
|
262
265
|
|
263
266
|
|
264
267
|
## Contributing
|
@@ -286,7 +289,7 @@ Don't forget to run `appraisal update` after any changes to `Gemfile`.
|
|
286
289
|
|
287
290
|
## Copyright
|
288
291
|
|
289
|
-
Copyright (c)
|
292
|
+
Copyright (c) 2020-2021 Alexey Zapparov, SensorTower Inc.
|
290
293
|
See LICENSE.md for further details.
|
291
294
|
|
292
295
|
|
@@ -5,9 +5,9 @@ source "https://rubygems.org"
|
|
5
5
|
gem "appraisal"
|
6
6
|
gem "rake"
|
7
7
|
gem "rspec"
|
8
|
-
gem "rubocop", "~> 0.
|
9
|
-
gem "rubocop-performance", "~>1.
|
10
|
-
gem "rubocop-rspec", "~> 1.
|
8
|
+
gem "rubocop", "~> 0.90.0", require: false
|
9
|
+
gem "rubocop-performance", "~> 1.8.0", require: false
|
10
|
+
gem "rubocop-rspec", "~> 1.43.2", require: false
|
11
11
|
gem "sidekiq", "~> 5.0.0"
|
12
12
|
|
13
13
|
group :development do
|
@@ -5,9 +5,9 @@ source "https://rubygems.org"
|
|
5
5
|
gem "appraisal"
|
6
6
|
gem "rake"
|
7
7
|
gem "rspec"
|
8
|
-
gem "rubocop", "~> 0.
|
9
|
-
gem "rubocop-performance", "~>1.
|
10
|
-
gem "rubocop-rspec", "~> 1.
|
8
|
+
gem "rubocop", "~> 0.90.0", require: false
|
9
|
+
gem "rubocop-performance", "~> 1.8.0", require: false
|
10
|
+
gem "rubocop-rspec", "~> 1.43.2", require: false
|
11
11
|
gem "sidekiq", "~> 5.1.0"
|
12
12
|
|
13
13
|
group :development do
|
@@ -5,9 +5,9 @@ source "https://rubygems.org"
|
|
5
5
|
gem "appraisal"
|
6
6
|
gem "rake"
|
7
7
|
gem "rspec"
|
8
|
-
gem "rubocop", "~> 0.
|
9
|
-
gem "rubocop-performance", "~>1.
|
10
|
-
gem "rubocop-rspec", "~> 1.
|
8
|
+
gem "rubocop", "~> 0.90.0", require: false
|
9
|
+
gem "rubocop-performance", "~> 1.8.0", require: false
|
10
|
+
gem "rubocop-rspec", "~> 1.43.2", require: false
|
11
11
|
gem "sidekiq", "~> 5.2.0"
|
12
12
|
|
13
13
|
group :development do
|
@@ -5,9 +5,9 @@ source "https://rubygems.org"
|
|
5
5
|
gem "appraisal"
|
6
6
|
gem "rake"
|
7
7
|
gem "rspec"
|
8
|
-
gem "rubocop", "~> 0.
|
9
|
-
gem "rubocop-performance", "~>1.
|
10
|
-
gem "rubocop-rspec", "~> 1.
|
8
|
+
gem "rubocop", "~> 0.90.0", require: false
|
9
|
+
gem "rubocop-performance", "~> 1.8.0", require: false
|
10
|
+
gem "rubocop-rspec", "~> 1.43.2", require: false
|
11
11
|
gem "sidekiq", "~> 6.0.0"
|
12
12
|
|
13
13
|
group :development do
|
@@ -5,9 +5,9 @@ source "https://rubygems.org"
|
|
5
5
|
gem "appraisal"
|
6
6
|
gem "rake"
|
7
7
|
gem "rspec"
|
8
|
-
gem "rubocop", "~> 0.
|
9
|
-
gem "rubocop-performance", "~>1.
|
10
|
-
gem "rubocop-rspec", "~> 1.
|
8
|
+
gem "rubocop", "~> 0.90.0", require: false
|
9
|
+
gem "rubocop-performance", "~> 1.8.0", require: false
|
10
|
+
gem "rubocop-rspec", "~> 1.43.2", require: false
|
11
11
|
gem "sidekiq", "~> 6.1.0"
|
12
12
|
|
13
13
|
group :development do
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "appraisal"
|
6
|
+
gem "rake"
|
7
|
+
gem "rspec"
|
8
|
+
gem "rubocop", "~> 0.90.0", require: false
|
9
|
+
gem "rubocop-performance", "~> 1.8.0", require: false
|
10
|
+
gem "rubocop-rspec", "~> 1.43.2", require: false
|
11
|
+
gem "sidekiq", "~> 6.2.0"
|
12
|
+
|
13
|
+
group :development do
|
14
|
+
gem "byebug"
|
15
|
+
gem "guard", require: false
|
16
|
+
gem "guard-rspec", require: false
|
17
|
+
gem "guard-rubocop", require: false
|
18
|
+
end
|
19
|
+
|
20
|
+
group :test do
|
21
|
+
gem "apparition"
|
22
|
+
gem "capybara"
|
23
|
+
gem "coveralls", require: false
|
24
|
+
gem "puma"
|
25
|
+
gem "rack-test"
|
26
|
+
gem "simplecov"
|
27
|
+
gem "sinatra"
|
28
|
+
gem "timecop"
|
29
|
+
end
|
30
|
+
|
31
|
+
gemspec path: "../"
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "appraisal"
|
6
|
+
gem "rake"
|
7
|
+
gem "rspec"
|
8
|
+
gem "rubocop", "~> 0.90.0", require: false
|
9
|
+
gem "rubocop-performance", "~> 1.8.0", require: false
|
10
|
+
gem "rubocop-rspec", "~> 1.43.2", require: false
|
11
|
+
gem "sidekiq", "~> 6.3.0"
|
12
|
+
|
13
|
+
group :development do
|
14
|
+
gem "byebug"
|
15
|
+
gem "guard", require: false
|
16
|
+
gem "guard-rspec", require: false
|
17
|
+
gem "guard-rubocop", require: false
|
18
|
+
end
|
19
|
+
|
20
|
+
group :test do
|
21
|
+
gem "apparition"
|
22
|
+
gem "capybara"
|
23
|
+
gem "coveralls", require: false
|
24
|
+
gem "puma"
|
25
|
+
gem "rack-test"
|
26
|
+
gem "simplecov"
|
27
|
+
gem "sinatra"
|
28
|
+
gem "timecop"
|
29
|
+
end
|
30
|
+
|
31
|
+
gemspec path: "../"
|
@@ -53,15 +53,13 @@ module Sidekiq
|
|
53
53
|
# @param [#to_s] event
|
54
54
|
# @param [Object] payload
|
55
55
|
# @return [void]
|
56
|
-
def run(event, payload = nil)
|
56
|
+
def run(event, payload = nil)
|
57
57
|
@mutex.synchronize do
|
58
58
|
fiber = Fiber.new do
|
59
59
|
@handlers[event.to_s].each do |callback|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
handle_exception(e, :context => "sidekiq:throttled")
|
64
|
-
end
|
60
|
+
callback.call(payload)
|
61
|
+
rescue => e
|
62
|
+
handle_exception(e, :context => "sidekiq:throttled")
|
65
63
|
end
|
66
64
|
end
|
67
65
|
|
@@ -60,10 +60,9 @@ module Sidekiq
|
|
60
60
|
def make_strategy(strategy, name, key_suffix, options)
|
61
61
|
return unless options
|
62
62
|
|
63
|
-
strategy.new("throttled:#{name}",
|
63
|
+
strategy.new("throttled:#{name}",
|
64
64
|
:key_suffix => key_suffix,
|
65
|
-
**options
|
66
|
-
})
|
65
|
+
**options)
|
67
66
|
end
|
68
67
|
end
|
69
68
|
end
|
data/sidekiq-throttled.gemspec
CHANGED
@@ -24,11 +24,11 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
25
25
|
spec.require_paths = ["lib"]
|
26
26
|
|
27
|
-
spec.required_ruby_version = "
|
27
|
+
spec.required_ruby_version = ">= 2.6"
|
28
28
|
|
29
29
|
spec.add_runtime_dependency "concurrent-ruby"
|
30
30
|
spec.add_runtime_dependency "redis-prescription"
|
31
31
|
spec.add_runtime_dependency "sidekiq"
|
32
32
|
|
33
|
-
spec.add_development_dependency "bundler", "
|
33
|
+
spec.add_development_dependency "bundler", ">= 2.0"
|
34
34
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq-throttled
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexey V Zapparov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -56,14 +56,14 @@ dependencies:
|
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '2.0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '2.0'
|
69
69
|
description: Concurrency and threshold throttling for Sidekiq.
|
@@ -99,6 +99,8 @@ files:
|
|
99
99
|
- gemfiles/sidekiq_5.2.gemfile
|
100
100
|
- gemfiles/sidekiq_6.0.gemfile
|
101
101
|
- gemfiles/sidekiq_6.1.gemfile
|
102
|
+
- gemfiles/sidekiq_6.2.gemfile
|
103
|
+
- gemfiles/sidekiq_6.3.gemfile
|
102
104
|
- lib/sidekiq/throttled.rb
|
103
105
|
- lib/sidekiq/throttled/communicator.rb
|
104
106
|
- lib/sidekiq/throttled/communicator/callbacks.rb
|
@@ -141,7 +143,7 @@ require_paths:
|
|
141
143
|
- lib
|
142
144
|
required_ruby_version: !ruby/object:Gem::Requirement
|
143
145
|
requirements:
|
144
|
-
- - "
|
146
|
+
- - ">="
|
145
147
|
- !ruby/object:Gem::Version
|
146
148
|
version: '2.6'
|
147
149
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
@@ -150,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
152
|
- !ruby/object:Gem::Version
|
151
153
|
version: '0'
|
152
154
|
requirements: []
|
153
|
-
rubygems_version: 3.
|
155
|
+
rubygems_version: 3.2.22
|
154
156
|
signing_key:
|
155
157
|
specification_version: 4
|
156
158
|
summary: Concurrency and threshold throttling for Sidekiq.
|