sidekiq-limit_fetch 3.4.0 → 4.0.0

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
- SHA1:
3
- metadata.gz: 90670344f1d8eaa97d215118db466740393123aa
4
- data.tar.gz: 3364780aa3ff90b22d4156d7a2eb6b315ca072b9
2
+ SHA256:
3
+ metadata.gz: 88e19126b173869fae0b5046533e8615d2785fb903f01b979cbcdea65e7824b5
4
+ data.tar.gz: 212cfdcf179fa2aceb6eb065e7bd384109f3afbf2ff08da27699197a300cf044
5
5
  SHA512:
6
- metadata.gz: f27825c415fa9995330e61bf78877fe20bbb1e1af4782d9e3072803092a55e170569d80cdd9f8bd0966c81c562fda120f5b0fd878b06e78532731e5490a20bfd
7
- data.tar.gz: 1d326108a6cc523131e44337c3f7e43116f7775d6f7a538b5d4a6ce63f276010a9ee379429bec18be725931ecd35d20a5f2b2eeb5bb3df5eeb86e5df406bbe95
6
+ metadata.gz: 0f0c99a5e6d183f9ce41c7bfd85f74926efad1515f29d88d24c7c1076b108121ed9c963ea60d76406c4a006e9b49dcb09239d9fe5b14e59e8f3702b7e4591689
7
+ data.tar.gz: 888322ef2940592c4d65095b136a4a4cf27cfe7f9bb470cb071fe3a47028cd095fc9b4c30392cb3d25be26536126851f357a61f6b31145dfb31add97f9250bec
@@ -0,0 +1,42 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ test:
11
+
12
+ runs-on: ubuntu-latest
13
+
14
+ strategy:
15
+ fail-fast: false
16
+ matrix:
17
+ ruby: ["2.6", "2.7", "3.0", "3.1", jruby-9.3]
18
+ appraisal: ['5.0', '5.1', '5.2', '6.0', '6.1', '6.2', '6.3', '6.4']
19
+ services:
20
+ redis:
21
+ image: redis
22
+ options: >-
23
+ --health-cmd "redis-cli ping"
24
+ --health-interval 10s
25
+ --health-timeout 5s
26
+ --health-retries 5
27
+ ports:
28
+ - 6379:6379
29
+
30
+ steps:
31
+ - uses: actions/checkout@v2
32
+ - name: Set up Ruby
33
+ uses: ruby/setup-ruby@v1
34
+ with:
35
+ ruby-version: ${{ matrix.ruby }}
36
+ bundler-cache: false
37
+ - name: Bundle for Appraisal
38
+ run: bundle
39
+ - name: Install Appraisal dependencies
40
+ run: bundle exec appraisal sidekiq-${{ matrix.appraisal }} bundle
41
+ - name: Run tests
42
+ run: bundle exec appraisal sidekiq-${{ matrix.appraisal }} bundle exec rake
data/Appraisals ADDED
@@ -0,0 +1,35 @@
1
+ appraise 'sidekiq-5.0' do
2
+ gem 'sidekiq', '~> 5.0.0'
3
+ end
4
+
5
+ appraise 'sidekiq-5.1' do
6
+ gem 'sidekiq', '~> 5.1.0'
7
+ end
8
+
9
+ appraise 'sidekiq-5.2' do
10
+ gem 'sidekiq', '~> 5.2.0'
11
+ end
12
+
13
+ appraise 'sidekiq-6.0' do
14
+ gem 'sidekiq', '~> 6.0.0'
15
+ end
16
+
17
+ appraise 'sidekiq-6.1' do
18
+ gem 'sidekiq', '~> 6.1.0'
19
+ end
20
+
21
+ appraise 'sidekiq-6.2' do
22
+ gem 'sidekiq', '~> 6.2.0'
23
+ end
24
+
25
+ appraise 'sidekiq-6.3' do
26
+ gem 'sidekiq', '~> 6.3.0'
27
+ end
28
+
29
+ appraise 'sidekiq-6.4' do
30
+ gem 'sidekiq', '~> 6.4.0'
31
+ end
32
+
33
+ appraise 'sidekiq-master' do
34
+ gem 'sidekiq', github: 'mperham/sidekiq'
35
+ end
data/README.md CHANGED
@@ -1,27 +1,30 @@
1
1
  ## Description
2
2
 
3
- Sidekiq strategy to support a granular queue control
4
- limiting, pausing, blocking, querying.
3
+ *This project is currently being taken over by [@deanpcmad](https://github.com/deanpcmad) and will be updated soon*
5
4
 
6
- [![Build Status](https://secure.travis-ci.org/brainopia/sidekiq-limit_fetch.png)](http://travis-ci.org/brainopia/sidekiq-limit_fetch)
7
- [![Gem Version](https://badge.fury.io/rb/sidekiq-limit_fetch.png)](http://badge.fury.io/rb/sidekiq-limit_fetch)
8
- [![Dependency Status](https://gemnasium.com/brainopia/sidekiq-limit_fetch.png)](https://gemnasium.com/brainopia/sidekiq-limit_fetch)
9
- [![Code Climate](https://codeclimate.com/github/brainopia/sidekiq-limit_fetch.png)](https://codeclimate.com/github/brainopia/sidekiq-limit_fetch)
5
+ Sidekiq strategy to support a granular queue control – limiting, pausing, blocking, querying.
10
6
 
11
- ## Installation
7
+ [![CI](https://github.com/deanpcmad/sidekiq-limit_fetch/actions/workflows/ci.yml/badge.svg)](https://github.com/deanpcmad/sidekiq-limit_fetch/actions/workflows/ci.yml)
8
+ [![Gem Version](https://badge.fury.io/rb/sidekiq-limit_fetch.svg)](http://badge.fury.io/rb/sidekiq-limit_fetch)
9
+
10
+ ### Installation
12
11
 
13
12
  Add this line to your application's Gemfile:
14
13
 
15
14
  gem 'sidekiq-limit_fetch'
16
15
 
17
- ### Requirements
16
+ ### Limitations
18
17
 
19
18
  **Important note:** At this moment, `sidekiq-limit_fetch` is incompatible with
20
19
  - sidekiq pro's `reliable_fetch`
21
20
  - `sidekiq-rate-limiter`
22
21
  - any other plugin that rewrites fetch strategy of sidekiq.
23
22
 
24
- ## Usage
23
+ ### Usage
24
+
25
+ If you are using this with Rails, you don't need to require it as it's done automatically.
26
+
27
+ To use this Gem in other Ruby projects, just add `require 'sidekiq-limit_fetch'`.
25
28
 
26
29
  ### Limits
27
30
 
@@ -71,7 +74,7 @@ You can see how many workers currently handling a queue:
71
74
 
72
75
  ### Pauses
73
76
 
74
- You can also pause your queues temporarely. Upon continuing their limits
77
+ You can also pause your queues temporarily. Upon continuing their limits
75
78
  will be preserved.
76
79
 
77
80
  ```ruby
@@ -148,9 +151,3 @@ Dynamic queues will be ran at the lowest priority.
148
151
  ### Maintenance
149
152
 
150
153
  If you use ```flushdb```, restart the sidekiq process to re-populate the dynamic configuration.
151
-
152
- ### Thanks
153
-
154
- <a href="https://evilmartians.com/?utm_source=sidekiq-limit_fetch">
155
- <img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg" alt="Sponsored by Evil Martians" width="236" height="54"></a>
156
-
data/demo/Gemfile CHANGED
@@ -1,8 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem 'rails'
4
- gem 'sinatra'
5
- gem 'celluloid'
6
4
  gem 'launchy'
7
5
  gem 'sidekiq', github: 'mperham/sidekiq'
8
6
  gem 'sidekiq-limit_fetch', path: '..'
data/demo/Rakefile CHANGED
@@ -78,7 +78,7 @@ namespace :demo do
78
78
  Rack::Server.start app: Sidekiq::Web, Port: 3000
79
79
  end
80
80
  sleep 1
81
- Launchy.open 'http://127.0.0.1:3000/workers?poll=true'
81
+ Launchy.open 'http://127.0.0.1:3000/busy?poll=true'
82
82
  end
83
83
 
84
84
  def run_sidekiq_workers(options)
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "sidekiq", "~> 5.0.0"
6
+
7
+ gemspec path: "../"
@@ -0,0 +1,57 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ sidekiq-limit_fetch (3.4.0)
5
+ redis (>= 4.6.0)
6
+ sidekiq (>= 4)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ appraisal (2.4.1)
12
+ bundler
13
+ rake
14
+ thor (>= 0.14.0)
15
+ concurrent-ruby (1.1.10)
16
+ connection_pool (2.2.5)
17
+ diff-lcs (1.5.0)
18
+ rack (2.2.3)
19
+ rack-protection (2.2.0)
20
+ rack
21
+ rake (13.0.6)
22
+ redis (4.6.0)
23
+ redis-namespace (1.8.2)
24
+ redis (>= 3.0.4)
25
+ rspec (3.11.0)
26
+ rspec-core (~> 3.11.0)
27
+ rspec-expectations (~> 3.11.0)
28
+ rspec-mocks (~> 3.11.0)
29
+ rspec-core (3.11.0)
30
+ rspec-support (~> 3.11.0)
31
+ rspec-expectations (3.11.0)
32
+ diff-lcs (>= 1.2.0, < 2.0)
33
+ rspec-support (~> 3.11.0)
34
+ rspec-mocks (3.11.0)
35
+ diff-lcs (>= 1.2.0, < 2.0)
36
+ rspec-support (~> 3.11.0)
37
+ rspec-support (3.11.0)
38
+ sidekiq (5.0.5)
39
+ concurrent-ruby (~> 1.0)
40
+ connection_pool (~> 2.2, >= 2.2.0)
41
+ rack-protection (>= 1.5.0)
42
+ redis (>= 3.3.4, < 5)
43
+ thor (1.2.1)
44
+
45
+ PLATFORMS
46
+ x86_64-linux
47
+
48
+ DEPENDENCIES
49
+ appraisal
50
+ rake
51
+ redis-namespace (~> 1.5, >= 1.5.2)
52
+ rspec
53
+ sidekiq (~> 5.0.0)
54
+ sidekiq-limit_fetch!
55
+
56
+ BUNDLED WITH
57
+ 2.3.6
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "sidekiq", "~> 5.1.0"
6
+
7
+ gemspec path: "../"
@@ -0,0 +1,57 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ sidekiq-limit_fetch (3.4.0)
5
+ redis (>= 4.6.0)
6
+ sidekiq (>= 4)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ appraisal (2.4.1)
12
+ bundler
13
+ rake
14
+ thor (>= 0.14.0)
15
+ concurrent-ruby (1.1.10)
16
+ connection_pool (2.2.5)
17
+ diff-lcs (1.5.0)
18
+ rack (2.2.3)
19
+ rack-protection (2.2.0)
20
+ rack
21
+ rake (13.0.6)
22
+ redis (4.6.0)
23
+ redis-namespace (1.8.2)
24
+ redis (>= 3.0.4)
25
+ rspec (3.11.0)
26
+ rspec-core (~> 3.11.0)
27
+ rspec-expectations (~> 3.11.0)
28
+ rspec-mocks (~> 3.11.0)
29
+ rspec-core (3.11.0)
30
+ rspec-support (~> 3.11.0)
31
+ rspec-expectations (3.11.0)
32
+ diff-lcs (>= 1.2.0, < 2.0)
33
+ rspec-support (~> 3.11.0)
34
+ rspec-mocks (3.11.0)
35
+ diff-lcs (>= 1.2.0, < 2.0)
36
+ rspec-support (~> 3.11.0)
37
+ rspec-support (3.11.0)
38
+ sidekiq (5.1.3)
39
+ concurrent-ruby (~> 1.0)
40
+ connection_pool (~> 2.2, >= 2.2.0)
41
+ rack-protection (>= 1.5.0)
42
+ redis (>= 3.3.5, < 5)
43
+ thor (1.2.1)
44
+
45
+ PLATFORMS
46
+ x86_64-linux
47
+
48
+ DEPENDENCIES
49
+ appraisal
50
+ rake
51
+ redis-namespace (~> 1.5, >= 1.5.2)
52
+ rspec
53
+ sidekiq (~> 5.1.0)
54
+ sidekiq-limit_fetch!
55
+
56
+ BUNDLED WITH
57
+ 2.3.6
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "sidekiq", "~> 5.2.0"
6
+
7
+ gemspec path: "../"
@@ -0,0 +1,56 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ sidekiq-limit_fetch (3.4.0)
5
+ redis (>= 4.6.0)
6
+ sidekiq (>= 4)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ appraisal (2.4.1)
12
+ bundler
13
+ rake
14
+ thor (>= 0.14.0)
15
+ connection_pool (2.2.5)
16
+ diff-lcs (1.5.0)
17
+ rack (2.0.9)
18
+ rack-protection (2.2.0)
19
+ rack
20
+ rake (13.0.6)
21
+ redis (4.6.0)
22
+ redis-namespace (1.8.2)
23
+ redis (>= 3.0.4)
24
+ rspec (3.11.0)
25
+ rspec-core (~> 3.11.0)
26
+ rspec-expectations (~> 3.11.0)
27
+ rspec-mocks (~> 3.11.0)
28
+ rspec-core (3.11.0)
29
+ rspec-support (~> 3.11.0)
30
+ rspec-expectations (3.11.0)
31
+ diff-lcs (>= 1.2.0, < 2.0)
32
+ rspec-support (~> 3.11.0)
33
+ rspec-mocks (3.11.0)
34
+ diff-lcs (>= 1.2.0, < 2.0)
35
+ rspec-support (~> 3.11.0)
36
+ rspec-support (3.11.0)
37
+ sidekiq (5.2.8)
38
+ connection_pool (~> 2.2, >= 2.2.2)
39
+ rack (< 2.1.0)
40
+ rack-protection (>= 1.5.0)
41
+ redis (>= 3.3.5, < 5)
42
+ thor (1.2.1)
43
+
44
+ PLATFORMS
45
+ x86_64-linux
46
+
47
+ DEPENDENCIES
48
+ appraisal
49
+ rake
50
+ redis-namespace (~> 1.5, >= 1.5.2)
51
+ rspec
52
+ sidekiq (~> 5.2.0)
53
+ sidekiq-limit_fetch!
54
+
55
+ BUNDLED WITH
56
+ 2.3.6
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "sidekiq", "~> 6.0.0"
6
+
7
+ gemspec path: "../"
@@ -0,0 +1,56 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ sidekiq-limit_fetch (3.4.0)
5
+ redis (>= 4.6.0)
6
+ sidekiq (>= 4)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ appraisal (2.4.1)
12
+ bundler
13
+ rake
14
+ thor (>= 0.14.0)
15
+ connection_pool (2.2.5)
16
+ diff-lcs (1.5.0)
17
+ rack (2.2.3)
18
+ rack-protection (2.2.0)
19
+ rack
20
+ rake (13.0.6)
21
+ redis (4.6.0)
22
+ redis-namespace (1.8.2)
23
+ redis (>= 3.0.4)
24
+ rspec (3.11.0)
25
+ rspec-core (~> 3.11.0)
26
+ rspec-expectations (~> 3.11.0)
27
+ rspec-mocks (~> 3.11.0)
28
+ rspec-core (3.11.0)
29
+ rspec-support (~> 3.11.0)
30
+ rspec-expectations (3.11.0)
31
+ diff-lcs (>= 1.2.0, < 2.0)
32
+ rspec-support (~> 3.11.0)
33
+ rspec-mocks (3.11.0)
34
+ diff-lcs (>= 1.2.0, < 2.0)
35
+ rspec-support (~> 3.11.0)
36
+ rspec-support (3.11.0)
37
+ sidekiq (6.0.7)
38
+ connection_pool (>= 2.2.2)
39
+ rack (~> 2.0)
40
+ rack-protection (>= 2.0.0)
41
+ redis (>= 4.1.0)
42
+ thor (1.2.1)
43
+
44
+ PLATFORMS
45
+ x86_64-linux
46
+
47
+ DEPENDENCIES
48
+ appraisal
49
+ rake
50
+ redis-namespace (~> 1.5, >= 1.5.2)
51
+ rspec
52
+ sidekiq (~> 6.0.0)
53
+ sidekiq-limit_fetch!
54
+
55
+ BUNDLED WITH
56
+ 2.3.6
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "sidekiq", "~> 6.1.0"
6
+
7
+ gemspec path: "../"
@@ -0,0 +1,53 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ sidekiq-limit_fetch (3.4.0)
5
+ redis (>= 4.6.0)
6
+ sidekiq (>= 4)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ appraisal (2.4.1)
12
+ bundler
13
+ rake
14
+ thor (>= 0.14.0)
15
+ connection_pool (2.2.5)
16
+ diff-lcs (1.5.0)
17
+ rack (2.2.3)
18
+ rake (13.0.6)
19
+ redis (4.6.0)
20
+ redis-namespace (1.8.2)
21
+ redis (>= 3.0.4)
22
+ rspec (3.11.0)
23
+ rspec-core (~> 3.11.0)
24
+ rspec-expectations (~> 3.11.0)
25
+ rspec-mocks (~> 3.11.0)
26
+ rspec-core (3.11.0)
27
+ rspec-support (~> 3.11.0)
28
+ rspec-expectations (3.11.0)
29
+ diff-lcs (>= 1.2.0, < 2.0)
30
+ rspec-support (~> 3.11.0)
31
+ rspec-mocks (3.11.0)
32
+ diff-lcs (>= 1.2.0, < 2.0)
33
+ rspec-support (~> 3.11.0)
34
+ rspec-support (3.11.0)
35
+ sidekiq (6.1.3)
36
+ connection_pool (>= 2.2.2)
37
+ rack (~> 2.0)
38
+ redis (>= 4.2.0)
39
+ thor (1.2.1)
40
+
41
+ PLATFORMS
42
+ x86_64-linux
43
+
44
+ DEPENDENCIES
45
+ appraisal
46
+ rake
47
+ redis-namespace (~> 1.5, >= 1.5.2)
48
+ rspec
49
+ sidekiq (~> 6.1.0)
50
+ sidekiq-limit_fetch!
51
+
52
+ BUNDLED WITH
53
+ 2.3.6
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "sidekiq", "~> 6.2.0"
6
+
7
+ gemspec path: "../"
@@ -0,0 +1,53 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ sidekiq-limit_fetch (3.4.0)
5
+ redis (>= 4.6.0)
6
+ sidekiq (>= 4)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ appraisal (2.4.1)
12
+ bundler
13
+ rake
14
+ thor (>= 0.14.0)
15
+ connection_pool (2.2.5)
16
+ diff-lcs (1.5.0)
17
+ rack (2.2.3)
18
+ rake (13.0.6)
19
+ redis (4.6.0)
20
+ redis-namespace (1.8.2)
21
+ redis (>= 3.0.4)
22
+ rspec (3.11.0)
23
+ rspec-core (~> 3.11.0)
24
+ rspec-expectations (~> 3.11.0)
25
+ rspec-mocks (~> 3.11.0)
26
+ rspec-core (3.11.0)
27
+ rspec-support (~> 3.11.0)
28
+ rspec-expectations (3.11.0)
29
+ diff-lcs (>= 1.2.0, < 2.0)
30
+ rspec-support (~> 3.11.0)
31
+ rspec-mocks (3.11.0)
32
+ diff-lcs (>= 1.2.0, < 2.0)
33
+ rspec-support (~> 3.11.0)
34
+ rspec-support (3.11.0)
35
+ sidekiq (6.2.1)
36
+ connection_pool (>= 2.2.2)
37
+ rack (~> 2.0)
38
+ redis (>= 4.2.0)
39
+ thor (1.2.1)
40
+
41
+ PLATFORMS
42
+ x86_64-linux
43
+
44
+ DEPENDENCIES
45
+ appraisal
46
+ rake
47
+ redis-namespace (~> 1.5, >= 1.5.2)
48
+ rspec
49
+ sidekiq (~> 6.2.0)
50
+ sidekiq-limit_fetch!
51
+
52
+ BUNDLED WITH
53
+ 2.3.6
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "sidekiq", "~> 6.3.0"
6
+
7
+ gemspec path: "../"
@@ -0,0 +1,53 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ sidekiq-limit_fetch (3.4.0)
5
+ redis (>= 4.6.0)
6
+ sidekiq (>= 4)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ appraisal (2.4.1)
12
+ bundler
13
+ rake
14
+ thor (>= 0.14.0)
15
+ connection_pool (2.2.5)
16
+ diff-lcs (1.5.0)
17
+ rack (2.2.3)
18
+ rake (13.0.6)
19
+ redis (4.6.0)
20
+ redis-namespace (1.8.2)
21
+ redis (>= 3.0.4)
22
+ rspec (3.11.0)
23
+ rspec-core (~> 3.11.0)
24
+ rspec-expectations (~> 3.11.0)
25
+ rspec-mocks (~> 3.11.0)
26
+ rspec-core (3.11.0)
27
+ rspec-support (~> 3.11.0)
28
+ rspec-expectations (3.11.0)
29
+ diff-lcs (>= 1.2.0, < 2.0)
30
+ rspec-support (~> 3.11.0)
31
+ rspec-mocks (3.11.0)
32
+ diff-lcs (>= 1.2.0, < 2.0)
33
+ rspec-support (~> 3.11.0)
34
+ rspec-support (3.11.0)
35
+ sidekiq (6.3.1)
36
+ connection_pool (>= 2.2.2)
37
+ rack (~> 2.0)
38
+ redis (>= 4.2.0)
39
+ thor (1.2.1)
40
+
41
+ PLATFORMS
42
+ x86_64-linux
43
+
44
+ DEPENDENCIES
45
+ appraisal
46
+ rake
47
+ redis-namespace (~> 1.5, >= 1.5.2)
48
+ rspec
49
+ sidekiq (~> 6.3.0)
50
+ sidekiq-limit_fetch!
51
+
52
+ BUNDLED WITH
53
+ 2.3.6
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "sidekiq", "~> 6.4.0"
6
+
7
+ gemspec path: "../"
@@ -0,0 +1,53 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ sidekiq-limit_fetch (3.4.0)
5
+ redis (>= 4.6.0)
6
+ sidekiq (>= 4)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ appraisal (2.4.1)
12
+ bundler
13
+ rake
14
+ thor (>= 0.14.0)
15
+ connection_pool (2.2.5)
16
+ diff-lcs (1.5.0)
17
+ rack (2.2.3)
18
+ rake (13.0.6)
19
+ redis (4.6.0)
20
+ redis-namespace (1.8.2)
21
+ redis (>= 3.0.4)
22
+ rspec (3.11.0)
23
+ rspec-core (~> 3.11.0)
24
+ rspec-expectations (~> 3.11.0)
25
+ rspec-mocks (~> 3.11.0)
26
+ rspec-core (3.11.0)
27
+ rspec-support (~> 3.11.0)
28
+ rspec-expectations (3.11.0)
29
+ diff-lcs (>= 1.2.0, < 2.0)
30
+ rspec-support (~> 3.11.0)
31
+ rspec-mocks (3.11.0)
32
+ diff-lcs (>= 1.2.0, < 2.0)
33
+ rspec-support (~> 3.11.0)
34
+ rspec-support (3.11.0)
35
+ sidekiq (6.4.1)
36
+ connection_pool (>= 2.2.2)
37
+ rack (~> 2.0)
38
+ redis (>= 4.2.0)
39
+ thor (1.2.1)
40
+
41
+ PLATFORMS
42
+ x86_64-linux
43
+
44
+ DEPENDENCIES
45
+ appraisal
46
+ rake
47
+ redis-namespace (~> 1.5, >= 1.5.2)
48
+ rspec
49
+ sidekiq (~> 6.4.0)
50
+ sidekiq-limit_fetch!
51
+
52
+ BUNDLED WITH
53
+ 2.3.6
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "sidekiq", github: "mperham/sidekiq"
6
+
7
+ gemspec path: "../"
@@ -0,0 +1,58 @@
1
+ GIT
2
+ remote: https://github.com/mperham/sidekiq.git
3
+ revision: cf7b067c89ae3b1303e35d29408099cf40991f6d
4
+ specs:
5
+ sidekiq (6.4.2)
6
+ connection_pool (>= 2.2.2)
7
+ rack (~> 2.0)
8
+ redis (>= 4.2.0)
9
+
10
+ PATH
11
+ remote: ..
12
+ specs:
13
+ sidekiq-limit_fetch (3.4.0)
14
+ redis (>= 4.6.0)
15
+ sidekiq (>= 4)
16
+
17
+ GEM
18
+ remote: https://rubygems.org/
19
+ specs:
20
+ appraisal (2.4.1)
21
+ bundler
22
+ rake
23
+ thor (>= 0.14.0)
24
+ connection_pool (2.2.5)
25
+ diff-lcs (1.5.0)
26
+ rack (2.2.3)
27
+ rake (13.0.6)
28
+ redis (4.6.0)
29
+ redis-namespace (1.8.2)
30
+ redis (>= 3.0.4)
31
+ rspec (3.11.0)
32
+ rspec-core (~> 3.11.0)
33
+ rspec-expectations (~> 3.11.0)
34
+ rspec-mocks (~> 3.11.0)
35
+ rspec-core (3.11.0)
36
+ rspec-support (~> 3.11.0)
37
+ rspec-expectations (3.11.0)
38
+ diff-lcs (>= 1.2.0, < 2.0)
39
+ rspec-support (~> 3.11.0)
40
+ rspec-mocks (3.11.0)
41
+ diff-lcs (>= 1.2.0, < 2.0)
42
+ rspec-support (~> 3.11.0)
43
+ rspec-support (3.11.0)
44
+ thor (1.2.1)
45
+
46
+ PLATFORMS
47
+ x86_64-linux
48
+
49
+ DEPENDENCIES
50
+ appraisal
51
+ rake
52
+ redis-namespace (~> 1.5, >= 1.5.2)
53
+ rspec
54
+ sidekiq!
55
+ sidekiq-limit_fetch!
56
+
57
+ BUNDLED WITH
58
+ 2.3.6
@@ -14,7 +14,8 @@ module Sidekiq
14
14
  :probed, :busy,
15
15
  :increase_busy, :decrease_busy,
16
16
  :local_busy?, :explain,
17
- :remove_locks_except!
17
+ :remove_locks_except!,
18
+ :clear_limits
18
19
 
19
20
  def lock
20
21
  @lock ||= LimitFetch::Global::Semaphore.new name
@@ -11,7 +11,7 @@ module Sidekiq::LimitFetch::Global
11
11
  Thread.new do
12
12
  loop do
13
13
  Sidekiq::LimitFetch.redis_retryable do
14
- add_dynamic_queues
14
+ handle_dynamic_queues
15
15
  update_heartbeat ttl
16
16
  invalidate_old_processes
17
17
  end
@@ -37,19 +37,19 @@ module Sidekiq::LimitFetch::Global
37
37
  end
38
38
  end
39
39
 
40
- def add_dynamic_queues
40
+ def handle_dynamic_queues
41
41
  queues = Sidekiq::LimitFetch::Queues
42
- queues.add Sidekiq::Queue.all.map(&:name) if queues.dynamic?
42
+ queues.handle Sidekiq::Queue.all.map(&:name) if queues.dynamic?
43
43
  end
44
44
 
45
45
  private
46
46
 
47
47
  def update_heartbeat(ttl)
48
48
  Sidekiq.redis do |it|
49
- it.multi do
50
- it.set heartbeat_key, true
51
- it.sadd PROCESS_SET, Selector.uuid
52
- it.expire heartbeat_key, ttl
49
+ it.multi do |pipeline|
50
+ pipeline.set heartbeat_key, true
51
+ pipeline.sadd PROCESS_SET, Selector.uuid
52
+ pipeline.expire heartbeat_key, ttl
53
53
  end
54
54
  end
55
55
  end
@@ -109,6 +109,14 @@ module Sidekiq::LimitFetch::Global
109
109
  redis {|it| it.get "#{PREFIX}:block:#@name" }
110
110
  end
111
111
 
112
+ def clear_limits
113
+ redis do |it|
114
+ %w(block busy limit pause probed process_limit).each do |key|
115
+ it.del "#{PREFIX}:#{key}:#@name"
116
+ end
117
+ end
118
+ end
119
+
112
120
  def increase_local_busy
113
121
  @lock.synchronize { @local_busy += 1 }
114
122
  end
@@ -16,4 +16,8 @@ module Sidekiq::LimitFetch::Instances
16
16
  def reset_instances!
17
17
  @instances = {}
18
18
  end
19
+
20
+ def delete_instance(name)
21
+ @instances.delete [name]
22
+ end
19
23
  end
@@ -5,6 +5,7 @@ module Sidekiq::LimitFetch::Queues
5
5
 
6
6
  def start(options)
7
7
  @queues = options[:queues]
8
+ @startup_queues = options[:queues].dup
8
9
  @dynamic = options[:dynamic]
9
10
 
10
11
  @limits = options[:limits] || {}
@@ -37,17 +38,40 @@ module Sidekiq::LimitFetch::Queues
37
38
  @dynamic
38
39
  end
39
40
 
41
+ def startup_queue?(queue)
42
+ @startup_queues.include?(queue)
43
+ end
44
+
40
45
  def add(queues)
46
+ return unless queues
41
47
  queues.each do |queue|
42
48
  unless @queues.include? queue
43
- apply_process_limit_to_queue(queue)
44
- apply_limit_to_queue(queue)
49
+ if startup_queue?(queue)
50
+ apply_process_limit_to_queue(queue)
51
+ apply_limit_to_queue(queue)
52
+ end
45
53
 
46
54
  @queues.push queue
47
55
  end
48
56
  end
49
57
  end
50
58
 
59
+ def remove(queues)
60
+ return unless queues
61
+ queues.each do |queue|
62
+ if @queues.include? queue
63
+ clear_limits_for_queue(queue)
64
+ @queues.delete queue
65
+ Sidekiq::Queue.delete_instance(queue)
66
+ end
67
+ end
68
+ end
69
+
70
+ def handle(queues)
71
+ add(queues - @queues)
72
+ remove(@queues - queues)
73
+ end
74
+
51
75
  def strict_order!
52
76
  @queues.uniq!
53
77
  def ordered_queues; @queues end
@@ -108,6 +132,11 @@ module Sidekiq::LimitFetch::Queues
108
132
  end
109
133
  end
110
134
 
135
+ def clear_limits_for_queue(queue_name)
136
+ queue = Sidekiq::Queue[queue_name]
137
+ queue.clear_limits
138
+ end
139
+
111
140
  def selector
112
141
  Sidekiq::LimitFetch::Global::Selector
113
142
  end
@@ -26,8 +26,14 @@ module Sidekiq::LimitFetch
26
26
  UnitOfWork.new(queue, job) if job
27
27
  end
28
28
 
29
+ # Backwards compatibility for sidekiq v6.1.0
30
+ # @see https://github.com/mperham/sidekiq/pull/4602
29
31
  def bulk_requeue(*args)
30
- Sidekiq::BasicFetch.bulk_requeue(*args)
32
+ if Sidekiq::BasicFetch.respond_to?(:bulk_requeue) # < 6.1.0
33
+ Sidekiq::BasicFetch.bulk_requeue(*args)
34
+ else # 6.1.0+
35
+ Sidekiq::BasicFetch.new(Sidekiq.options).bulk_requeue(*args)
36
+ end
31
37
  end
32
38
 
33
39
  def redis_retryable
@@ -1,22 +1,21 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = 'sidekiq-limit_fetch'
3
- gem.version = '3.4.0'
3
+ gem.version = '4.0.0'
4
4
  gem.license = 'MIT'
5
- gem.authors = 'brainopia'
6
- gem.email = 'brainopia@evilmartians.com'
5
+ gem.authors = ['Dean Perry', 'brainopia']
6
+ gem.email = 'dean@deanpcmad.com'
7
7
  gem.summary = 'Sidekiq strategy to support queue limits'
8
- gem.homepage = 'https://github.com/brainopia/sidekiq-limit_fetch'
9
- gem.description = <<-DESCRIPTION
10
- Sidekiq strategy to restrict number of workers
11
- which are able to run specified queues simultaneously.
12
- DESCRIPTION
8
+ gem.homepage = 'https://github.com/deanpcmad/sidekiq-limit_fetch'
9
+ gem.description = "Sidekiq strategy to restrict number of workers which are able to run specified queues simultaneously."
13
10
 
14
11
  gem.files = `git ls-files`.split($/)
15
12
  gem.test_files = gem.files.grep %r{^spec/}
16
13
  gem.require_paths = %w(lib)
17
14
 
18
15
  gem.add_dependency 'sidekiq', '>= 4'
16
+ gem.add_dependency 'redis', '>= 4.6.0'
19
17
  gem.add_development_dependency 'redis-namespace', '~> 1.5', '>= 1.5.2'
18
+ gem.add_development_dependency 'appraisal'
20
19
  gem.add_development_dependency 'rspec'
21
20
  gem.add_development_dependency 'rake'
22
21
  end
data/spec/spec_helper.rb CHANGED
@@ -11,13 +11,13 @@ RSpec.configure do |config|
11
11
  Sidekiq::Queue.reset_instances!
12
12
  Sidekiq.redis do |it|
13
13
  clean_redis = ->(queue) do
14
- it.pipelined do
15
- it.del "limit_fetch:limit:#{queue}"
16
- it.del "limit_fetch:process_limit:#{queue}"
17
- it.del "limit_fetch:busy:#{queue}"
18
- it.del "limit_fetch:probed:#{queue}"
19
- it.del "limit_fetch:pause:#{queue}"
20
- it.del "limit_fetch:block:#{queue}"
14
+ it.pipelined do |pipeline|
15
+ pipeline.del "limit_fetch:limit:#{queue}"
16
+ pipeline.del "limit_fetch:process_limit:#{queue}"
17
+ pipeline.del "limit_fetch:busy:#{queue}"
18
+ pipeline.del "limit_fetch:probed:#{queue}"
19
+ pipeline.del "limit_fetch:pause:#{queue}"
20
+ pipeline.del "limit_fetch:block:#{queue}"
21
21
  end
22
22
  end
23
23
 
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-limit_fetch
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.0
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
+ - Dean Perry
7
8
  - brainopia
8
- autorequire:
9
+ autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2016-10-13 00:00:00.000000000 Z
12
+ date: 2022-03-26 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: sidekiq
@@ -17,13 +18,27 @@ dependencies:
17
18
  - - ">="
18
19
  - !ruby/object:Gem::Version
19
20
  version: '4'
21
+ type: :runtime
22
+ prerelease: false
20
23
  version_requirements: !ruby/object:Gem::Requirement
21
24
  requirements:
22
25
  - - ">="
23
26
  - !ruby/object:Gem::Version
24
27
  version: '4'
25
- prerelease: false
28
+ - !ruby/object:Gem::Dependency
29
+ name: redis
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: 4.6.0
26
35
  type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: 4.6.0
27
42
  - !ruby/object:Gem::Dependency
28
43
  name: redis-namespace
29
44
  requirement: !ruby/object:Gem::Requirement
@@ -34,6 +49,8 @@ dependencies:
34
49
  - - ">="
35
50
  - !ruby/object:Gem::Version
36
51
  version: 1.5.2
52
+ type: :development
53
+ prerelease: false
37
54
  version_requirements: !ruby/object:Gem::Requirement
38
55
  requirements:
39
56
  - - "~>"
@@ -42,8 +59,20 @@ dependencies:
42
59
  - - ">="
43
60
  - !ruby/object:Gem::Version
44
61
  version: 1.5.2
45
- prerelease: false
62
+ - !ruby/object:Gem::Dependency
63
+ name: appraisal
64
+ requirement: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
46
69
  type: :development
70
+ prerelease: false
71
+ version_requirements: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
47
76
  - !ruby/object:Gem::Dependency
48
77
  name: rspec
49
78
  requirement: !ruby/object:Gem::Requirement
@@ -51,13 +80,13 @@ dependencies:
51
80
  - - ">="
52
81
  - !ruby/object:Gem::Version
53
82
  version: '0'
83
+ type: :development
84
+ prerelease: false
54
85
  version_requirements: !ruby/object:Gem::Requirement
55
86
  requirements:
56
87
  - - ">="
57
88
  - !ruby/object:Gem::Version
58
89
  version: '0'
59
- prerelease: false
60
- type: :development
61
90
  - !ruby/object:Gem::Dependency
62
91
  name: rake
63
92
  requirement: !ruby/object:Gem::Requirement
@@ -65,24 +94,24 @@ dependencies:
65
94
  - - ">="
66
95
  - !ruby/object:Gem::Version
67
96
  version: '0'
97
+ type: :development
98
+ prerelease: false
68
99
  version_requirements: !ruby/object:Gem::Requirement
69
100
  requirements:
70
101
  - - ">="
71
102
  - !ruby/object:Gem::Version
72
103
  version: '0'
73
- prerelease: false
74
- type: :development
75
- description: |2
76
- Sidekiq strategy to restrict number of workers
77
- which are able to run specified queues simultaneously.
78
- email: brainopia@evilmartians.com
104
+ description: Sidekiq strategy to restrict number of workers which are able to run
105
+ specified queues simultaneously.
106
+ email: dean@deanpcmad.com
79
107
  executables: []
80
108
  extensions: []
81
109
  extra_rdoc_files: []
82
110
  files:
111
+ - ".github/workflows/ci.yml"
83
112
  - ".gitignore"
84
113
  - ".rspec"
85
- - ".travis.yml"
114
+ - Appraisals
86
115
  - Gemfile
87
116
  - LICENSE.txt
88
117
  - README.md
@@ -100,6 +129,24 @@ files:
100
129
  - demo/config/boot.rb
101
130
  - demo/config/environment.rb
102
131
  - demo/config/environments/development.rb
132
+ - gemfiles/sidekiq_5.0.gemfile
133
+ - gemfiles/sidekiq_5.0.gemfile.lock
134
+ - gemfiles/sidekiq_5.1.gemfile
135
+ - gemfiles/sidekiq_5.1.gemfile.lock
136
+ - gemfiles/sidekiq_5.2.gemfile
137
+ - gemfiles/sidekiq_5.2.gemfile.lock
138
+ - gemfiles/sidekiq_6.0.gemfile
139
+ - gemfiles/sidekiq_6.0.gemfile.lock
140
+ - gemfiles/sidekiq_6.1.gemfile
141
+ - gemfiles/sidekiq_6.1.gemfile.lock
142
+ - gemfiles/sidekiq_6.2.gemfile
143
+ - gemfiles/sidekiq_6.2.gemfile.lock
144
+ - gemfiles/sidekiq_6.3.gemfile
145
+ - gemfiles/sidekiq_6.3.gemfile.lock
146
+ - gemfiles/sidekiq_6.4.gemfile
147
+ - gemfiles/sidekiq_6.4.gemfile.lock
148
+ - gemfiles/sidekiq_master.gemfile
149
+ - gemfiles/sidekiq_master.gemfile.lock
103
150
  - lib/sidekiq-limit_fetch.rb
104
151
  - lib/sidekiq/extensions/manager.rb
105
152
  - lib/sidekiq/extensions/queue.rb
@@ -117,11 +164,11 @@ files:
117
164
  - spec/sidekiq/limit_fetch/semaphore_spec.rb
118
165
  - spec/sidekiq/limit_fetch_spec.rb
119
166
  - spec/spec_helper.rb
120
- homepage: https://github.com/brainopia/sidekiq-limit_fetch
167
+ homepage: https://github.com/deanpcmad/sidekiq-limit_fetch
121
168
  licenses:
122
169
  - MIT
123
170
  metadata: {}
124
- post_install_message:
171
+ post_install_message:
125
172
  rdoc_options: []
126
173
  require_paths:
127
174
  - lib
@@ -136,9 +183,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
183
  - !ruby/object:Gem::Version
137
184
  version: '0'
138
185
  requirements: []
139
- rubyforge_project:
140
- rubygems_version: 2.6.4
141
- signing_key:
186
+ rubygems_version: 3.1.6
187
+ signing_key:
142
188
  specification_version: 4
143
189
  summary: Sidekiq strategy to support queue limits
144
190
  test_files:
data/.travis.yml DELETED
@@ -1,10 +0,0 @@
1
- language: ruby
2
- before_install:
3
- - gem install bundler
4
- - gem update bundler
5
- rvm:
6
- - 2.3.1
7
- - 2.2.5
8
- - jruby-head
9
- services:
10
- - redis-server