HornsAndHooves-sidekiq-limit_fetch 4.5.0 → 5.0.0
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/.gitignore +1 -0
- data/.rubocop.yml +155 -33
- data/CHANGELOG.md +11 -0
- data/HornsAndHooves-sidekiq-limit_fetch.gemspec +29 -0
- data/README.md +303 -96
- data/Rakefile +5 -10
- data/lib/sidekiq/limit_fetch/global/limit_fetch.lua +74 -0
- data/lib/sidekiq/limit_fetch/global/selector.rb +35 -107
- data/lib/sidekiq/limit_fetch/global/semaphore.rb +111 -153
- data/lib/sidekiq/limit_fetch/global.rb +31 -0
- data/lib/sidekiq/limit_fetch/heartbeat.rb +98 -0
- data/lib/sidekiq/limit_fetch/unit_of_work.rb +7 -15
- data/lib/sidekiq/limit_fetch.rb +95 -55
- data/lib/sidekiq-limit_fetch.rb +1 -1
- data/spec/integration_spec.rb +831 -0
- data/spec/spec_helper.rb +8 -27
- metadata +8 -48
- data/bench/compare.rb +0 -56
- data/demo/Gemfile +0 -8
- data/demo/README.md +0 -37
- data/demo/Rakefile +0 -100
- data/demo/app/workers/a_worker.rb +0 -10
- data/demo/app/workers/b_worker.rb +0 -10
- data/demo/app/workers/c_worker.rb +0 -10
- data/demo/app/workers/fast_worker.rb +0 -10
- data/demo/app/workers/slow_worker.rb +0 -10
- data/demo/config/application.rb +0 -13
- data/demo/config/boot.rb +0 -4
- data/demo/config/environment.rb +0 -4
- data/demo/config/environments/development.rb +0 -11
- data/lib/sidekiq/extensions/manager.rb +0 -21
- data/lib/sidekiq/extensions/queue.rb +0 -27
- data/lib/sidekiq/limit_fetch/global/monitor.rb +0 -83
- data/lib/sidekiq/limit_fetch/instances.rb +0 -29
- data/lib/sidekiq/limit_fetch/queues.rb +0 -197
- data/sidekiq-limit_fetch.gemspec +0 -30
- data/spec/sidekiq/extensions/manager_spec.rb +0 -13
- data/spec/sidekiq/extensions/queue_spec.rb +0 -96
- data/spec/sidekiq/limit_fetch/global/monitor_spec.rb +0 -114
- data/spec/sidekiq/limit_fetch/queues_spec.rb +0 -127
- data/spec/sidekiq/limit_fetch/semaphore_spec.rb +0 -65
- data/spec/sidekiq/limit_fetch_spec.rb +0 -58
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e81bef8059ed7cf135f678ba2c147fa35e2600de28e46dbb962d3ee0b082420e
|
|
4
|
+
data.tar.gz: da5ab3200af51da4fbb8e26ac3172752b673b633ee277f0afe03d3cf49f19d9f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7fa8d94f966d12e108a33fa2d31a3cd400343f7f2d33c945b46396375bc8d4a2c387eddd0db97a38ff5984d9737aa159e479246c5447391df10155627f4ce344
|
|
7
|
+
data.tar.gz: 359de4f6874a1924dced480607f560a71243b6f19d1ec0910cae8b9633c6f1b1d8761b5d19aeb8d43926eafd3fe291d1f2c898858e9fa0c2886774e9f52d55cb
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
|
@@ -1,34 +1,156 @@
|
|
|
1
|
+
plugins: rubocop-rspec
|
|
2
|
+
|
|
3
|
+
Style/FrozenStringLiteralComment:
|
|
4
|
+
Enabled: true
|
|
5
|
+
|
|
6
|
+
Layout/EmptyLineAfterMagicComment:
|
|
7
|
+
Enabled: true
|
|
8
|
+
|
|
1
9
|
AllCops:
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
10
|
+
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
|
|
11
|
+
# to ignore them, so only the ones explicitly set in this file are enabled.
|
|
12
|
+
DisabledByDefault: true
|
|
13
|
+
|
|
14
|
+
# ======== Core ========
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# ==== Layout ====
|
|
18
|
+
#
|
|
19
|
+
# https://docs.rubocop.org/rubocop/cops_layout.html
|
|
20
|
+
|
|
21
|
+
# Enforce the . position in multi-line method calls
|
|
22
|
+
# https://docs.rubocop.org/rubocop/cops_layout.html#enforcedstyle-trailing
|
|
23
|
+
Layout/DotPosition:
|
|
24
|
+
EnforcedStyle: trailing
|
|
25
|
+
|
|
26
|
+
# Enfore newlines are Unix-style, not DOS-style.
|
|
27
|
+
# https://docs.rubocop.org/rubocop/cops_layout.html#layoutendofline
|
|
28
|
+
Layout/EndOfLine:
|
|
29
|
+
EnforcedStyle: lf
|
|
30
|
+
|
|
31
|
+
# NOTE: More research has to be done on indentation cops to see how they would effect existing code in services.
|
|
32
|
+
|
|
33
|
+
# https://docs.rubocop.org/rubocop/cops_layout.html#layoutfirstargumentindentation
|
|
34
|
+
# Layout/FirstArgumentIndentation:
|
|
35
|
+
# EnforcedStyle: consistent
|
|
36
|
+
|
|
37
|
+
# https://docs.rubocop.org/rubocop/cops_layout.html#layoutfirstarrayelementindentation
|
|
38
|
+
# Layout/FirstArrayElementIndentation:
|
|
39
|
+
# EnforcedStyle: consistent
|
|
40
|
+
|
|
41
|
+
# https://docs.rubocop.org/rubocop/cops_layout.html#layoutfirsthashelementindentation
|
|
42
|
+
# Layout/FirstHashElementIndentation:
|
|
43
|
+
# EnforcedStyle: consistent
|
|
44
|
+
|
|
45
|
+
# https://docs.rubocop.org/rubocop/cops_layout.html#layoutfirstparameterindentation
|
|
46
|
+
# Layout/FirstParameterIndentation:
|
|
47
|
+
# EnforcedStyle: consistent
|
|
48
|
+
|
|
49
|
+
# Enforce a trailing newline at the end of files.
|
|
50
|
+
# https://docs.rubocop.org/rubocop/cops_layout.html#layouttrailingemptylines
|
|
51
|
+
Layout/TrailingEmptyLines:
|
|
52
|
+
EnforcedStyle: final_newline
|
|
53
|
+
|
|
54
|
+
# Enforce no trailing whitespace.
|
|
55
|
+
# https://docs.rubocop.org/rubocop/cops_layout.html#layouttrailingwhitespace
|
|
56
|
+
Layout/TrailingWhitespace:
|
|
57
|
+
Enabled: true
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
# ==== Style ====
|
|
63
|
+
#
|
|
64
|
+
# https://docs.rubocop.org/rubocop/cops_style.html
|
|
65
|
+
|
|
66
|
+
Style/DefWithParentheses:
|
|
67
|
+
Enabled: true
|
|
68
|
+
|
|
69
|
+
Style/Dir:
|
|
70
|
+
Enabled: true
|
|
71
|
+
|
|
72
|
+
Style/EmptyBlockParameter:
|
|
73
|
+
Enabled: true
|
|
74
|
+
|
|
75
|
+
Style/EmptyLambdaParameter:
|
|
76
|
+
Enabled: true
|
|
77
|
+
|
|
78
|
+
Style/EvenOdd:
|
|
79
|
+
Enabled: true
|
|
80
|
+
|
|
81
|
+
Style/FileRead:
|
|
82
|
+
Enabled: true
|
|
83
|
+
|
|
84
|
+
Style/FileWrite:
|
|
85
|
+
Enabled: true
|
|
86
|
+
|
|
87
|
+
# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
|
|
88
|
+
Style/HashSyntax:
|
|
89
|
+
Enabled: true
|
|
90
|
+
EnforcedStyle: ruby19
|
|
91
|
+
EnforcedShorthandSyntax: either
|
|
92
|
+
|
|
93
|
+
Style/MethodCallWithoutArgsParentheses:
|
|
94
|
+
Enabled: true
|
|
95
|
+
|
|
96
|
+
Style/MethodDefParentheses:
|
|
97
|
+
Enabled: true
|
|
98
|
+
|
|
99
|
+
Style/MixinGrouping:
|
|
100
|
+
EnforcedStyle: separated
|
|
101
|
+
|
|
102
|
+
Style/MutableConstant:
|
|
103
|
+
EnforcedStyle: literals
|
|
104
|
+
|
|
105
|
+
Style/NestedTernaryOperator:
|
|
106
|
+
Enabled: true
|
|
107
|
+
|
|
108
|
+
Style/NilComparison:
|
|
109
|
+
EnforcedStyle: predicate
|
|
110
|
+
|
|
111
|
+
Style/RedundantBegin:
|
|
112
|
+
Enabled: true
|
|
113
|
+
|
|
114
|
+
Style/RedundantCapitalW:
|
|
115
|
+
Enabled: true
|
|
116
|
+
|
|
117
|
+
Style/RedundantFreeze:
|
|
118
|
+
Enabled: true
|
|
119
|
+
|
|
120
|
+
Style/RedundantReturn:
|
|
121
|
+
Enabled: true
|
|
122
|
+
|
|
123
|
+
Style/SelfAssignment:
|
|
124
|
+
Enabled: true
|
|
125
|
+
|
|
126
|
+
# Single quotes being faster is hardly measurable and only affects parse time.
|
|
127
|
+
# Enforcing double quotes reduces the times where you need to change them
|
|
128
|
+
# when introducing an interpolation. Use single quotes only if their semantics
|
|
129
|
+
# are needed.
|
|
130
|
+
Style/StringLiterals:
|
|
131
|
+
EnforcedStyle: double_quotes
|
|
132
|
+
|
|
133
|
+
# We do not need to support Ruby 1.9, so this is good to use.
|
|
134
|
+
Style/SymbolArray:
|
|
135
|
+
Enabled: true
|
|
136
|
+
|
|
137
|
+
Style/UnlessElse:
|
|
138
|
+
Enabled: true
|
|
139
|
+
|
|
140
|
+
Style/WhileUntilDo:
|
|
141
|
+
Enabled: true
|
|
142
|
+
|
|
143
|
+
Style/YodaCondition:
|
|
144
|
+
Enabled: true
|
|
145
|
+
|
|
146
|
+
# ==== RSpec ====
|
|
147
|
+
#
|
|
148
|
+
# https://docs.rubocop.org/rubocop-rspec/cops_rspec.html
|
|
149
|
+
|
|
150
|
+
# https://docs.rubocop.org/rubocop-rspec/cops_rspec.html#rspecbenil
|
|
151
|
+
RSpec/BeNil:
|
|
152
|
+
Enabled: true
|
|
153
|
+
|
|
154
|
+
# https://docs.rubocop.org/rubocop-rspec/cops_rspec.html#rspecnottonot
|
|
155
|
+
RSpec/NotToNot:
|
|
156
|
+
Enabled: true
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [5.0.0] - 2026-06-18
|
|
4
|
+
|
|
5
|
+
This release is a complete rewrite of the gem for Sidekiq 8+.
|
|
6
|
+
|
|
7
|
+
- Replace the legacy fetch implementation with a new `Sidekiq::LimitFetch` strategy built for Sidekiq 8's capsule/fetch model.
|
|
8
|
+
- Enforce queue concurrency limits atomically with a Redis Lua script that checks limits, pops jobs, and records busy slots in a single operation.
|
|
9
|
+
- Add Redis-backed global queue limits and per-process queue limits.
|
|
10
|
+
- Add heartbeat-based process registration and stale busy-slot reaping so queues recover after unclean Sidekiq shutdowns.
|
|
11
|
+
- Preserve Sidekiq's normal strict and weighted queue ordering while skipping queues whose limits are currently exhausted.
|
|
12
|
+
- Remove legacy APIs/features from older implementations, including queue pause/unpause helpers, blocking queue mode, dynamic queues, and `Sidekiq::Queue[...]` limit helpers.
|
|
13
|
+
|
|
3
14
|
## [4.5.0] - 2026-06-15
|
|
4
15
|
|
|
5
16
|
This project was taken over by [@HornsAndHooves](https://github.com/HornsAndHooves)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
Gem::Specification.new do |gem|
|
|
4
|
+
gem.version = "5.0.0"
|
|
5
|
+
|
|
6
|
+
gem.name = "HornsAndHooves-sidekiq-limit_fetch"
|
|
7
|
+
gem.license = "MIT"
|
|
8
|
+
gem.authors = ["HornsAndHooves", "Peter Maneykowski"]
|
|
9
|
+
gem.email = ["maneyko@integracredit.com"]
|
|
10
|
+
gem.summary = "Sidekiq strategy to support queue limits"
|
|
11
|
+
gem.homepage = "https://github.com/HornsAndHooves/sidekiq-limit_fetch"
|
|
12
|
+
gem.description = "Sidekiq strategy to restrict number of workers which are able to run specified queues simultaneously."
|
|
13
|
+
|
|
14
|
+
gem.metadata["homepage_uri"] = gem.homepage
|
|
15
|
+
gem.metadata["changelog_uri"] = gem.homepage + "/blob/master/CHANGELOG.md"
|
|
16
|
+
gem.metadata["source_code_uri"] = gem.homepage
|
|
17
|
+
|
|
18
|
+
gem.files = %w[CHANGELOG.md LICENSE README.md HornsAndHooves-sidekiq-limit_fetch.gemspec] + `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
|
19
|
+
gem.require_paths = %w[lib]
|
|
20
|
+
|
|
21
|
+
gem.required_ruby_version = ">= 2.7.0"
|
|
22
|
+
|
|
23
|
+
gem.add_dependency "sidekiq", ">= 8"
|
|
24
|
+
|
|
25
|
+
gem.add_development_dependency "rake"
|
|
26
|
+
gem.add_development_dependency "rspec"
|
|
27
|
+
gem.add_development_dependency "rubocop"
|
|
28
|
+
gem.add_development_dependency "simplecov"
|
|
29
|
+
end
|