sidekiq-limit_fetch 4.3.2 → 4.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +3 -1
  3. data/.rubocop.yml +29 -0
  4. data/Appraisals +6 -0
  5. data/Gemfile +2 -0
  6. data/README.md +11 -1
  7. data/Rakefile +2 -0
  8. data/bench/compare.rb +17 -13
  9. data/demo/Gemfile +3 -2
  10. data/demo/Rakefile +6 -5
  11. data/demo/app/workers/a_worker.rb +2 -0
  12. data/demo/app/workers/b_worker.rb +2 -0
  13. data/demo/app/workers/c_worker.rb +2 -1
  14. data/demo/app/workers/fast_worker.rb +2 -0
  15. data/demo/app/workers/slow_worker.rb +2 -0
  16. data/demo/config/application.rb +3 -1
  17. data/demo/config/boot.rb +4 -2
  18. data/demo/config/environment.rb +3 -1
  19. data/demo/config/environments/development.rb +2 -0
  20. data/docker-compose.dev.yml +13 -0
  21. data/gemfiles/sidekiq_6.0.gemfile.lock +3 -4
  22. data/gemfiles/sidekiq_6.1.gemfile.lock +3 -4
  23. data/gemfiles/sidekiq_6.2.gemfile.lock +3 -4
  24. data/gemfiles/sidekiq_6.3.gemfile.lock +3 -4
  25. data/gemfiles/sidekiq_6.4.gemfile.lock +3 -4
  26. data/gemfiles/sidekiq_6.5.gemfile.lock +3 -4
  27. data/gemfiles/sidekiq_7.0.gemfile +7 -0
  28. data/gemfiles/sidekiq_7.0.gemfile.lock +58 -0
  29. data/gemfiles/sidekiq_master.gemfile.lock +3 -4
  30. data/lib/sidekiq/extensions/manager.rb +21 -13
  31. data/lib/sidekiq/extensions/queue.rb +16 -13
  32. data/lib/sidekiq/limit_fetch/global/monitor.rb +64 -53
  33. data/lib/sidekiq/limit_fetch/global/selector.rb +49 -40
  34. data/lib/sidekiq/limit_fetch/global/semaphore.rb +130 -123
  35. data/lib/sidekiq/limit_fetch/instances.rb +22 -16
  36. data/lib/sidekiq/limit_fetch/queues.rb +165 -124
  37. data/lib/sidekiq/limit_fetch/unit_of_work.rb +26 -22
  38. data/lib/sidekiq/limit_fetch.rb +73 -54
  39. data/lib/sidekiq-limit_fetch.rb +2 -0
  40. data/sidekiq-limit_fetch.gemspec +20 -13
  41. data/spec/sidekiq/extensions/manager_spec.rb +19 -0
  42. data/spec/sidekiq/extensions/queue_spec.rb +2 -0
  43. data/spec/sidekiq/limit_fetch/global/monitor_spec.rb +86 -5
  44. data/spec/sidekiq/limit_fetch/queues_spec.rb +34 -18
  45. data/spec/sidekiq/limit_fetch/semaphore_spec.rb +2 -0
  46. data/spec/sidekiq/limit_fetch_spec.rb +14 -4
  47. data/spec/spec_helper.rb +15 -4
  48. metadata +34 -21
@@ -1,159 +1,200 @@
1
- module Sidekiq::LimitFetch::Queues
2
- extend self
1
+ # frozen_string_literal: true
2
+
3
+ module Sidekiq
4
+ module LimitFetch
5
+ module Queues
6
+ extend self
7
+
8
+ THREAD_KEY = :acquired_queues
9
+
10
+ # rubocop:disable Metrics/AbcSize
11
+ # rubocop:disable Metrics/CyclomaticComplexity
12
+ # rubocop:disable Metrics/MethodLength
13
+ # rubocop:disable Metrics/PerceivedComplexity
14
+ def start(capsule_or_options)
15
+ config = Sidekiq::LimitFetch.post_7? ? capsule_or_options.config : capsule_or_options
16
+
17
+ @queues = config[:queues].map do |queue|
18
+ if queue.is_a? Array
19
+ queue.first
20
+ else
21
+ queue
22
+ end
23
+ end.uniq
24
+ @startup_queues = @queues.dup
25
+
26
+ if config[:dynamic].is_a? Hash
27
+ @dynamic = true
28
+ @dynamic_exclude = config[:dynamic][:exclude] || []
29
+ else
30
+ @dynamic = config[:dynamic]
31
+ @dynamic_exclude = []
32
+ end
3
33
 
4
- THREAD_KEY = :acquired_queues
34
+ @limits = config[:limits] || {}
35
+ @process_limits = config[:process_limits] || {}
36
+ @blocks = config[:blocking] || []
5
37
 
6
- def start(options)
7
- @queues = options[:queues]
8
- @startup_queues = options[:queues].dup
9
- @dynamic = options[:dynamic]
38
+ config[:strict] ? strict_order! : weighted_order!
10
39
 
11
- @limits = options[:limits] || {}
12
- @process_limits = options[:process_limits] || {}
13
- @blocks = options[:blocking] || []
40
+ apply_process_limit_to_queues
41
+ apply_limit_to_queues
42
+ apply_blocks_to_queues
43
+ end
44
+ # rubocop:enable Metrics/AbcSize
45
+ # rubocop:enable Metrics/CyclomaticComplexity
46
+ # rubocop:enable Metrics/MethodLength
47
+ # rubocop:enable Metrics/PerceivedComplexity
48
+
49
+ def acquire
50
+ queues = saved
51
+ queues ||= Sidekiq::LimitFetch.redis_retryable do
52
+ selector.acquire(ordered_queues, namespace)
53
+ end
54
+ save queues
55
+ queues.map { |it| "queue:#{it}" }
56
+ end
14
57
 
15
- options[:strict] ? strict_order! : weighted_order!
58
+ def release_except(full_name)
59
+ queues = restore
60
+ queues.delete full_name[/queue:(.*)/, 1] if full_name
61
+ Sidekiq::LimitFetch.redis_retryable do
62
+ selector.release queues, namespace
63
+ end
64
+ end
16
65
 
17
- apply_process_limit_to_queues
18
- apply_limit_to_queues
19
- apply_blocks_to_queues
20
- end
66
+ def dynamic?
67
+ @dynamic
68
+ end
21
69
 
22
- def acquire
23
- queues = saved
24
- queues ||= Sidekiq::LimitFetch.redis_retryable do
25
- selector.acquire(ordered_queues, namespace)
26
- end
27
- save queues
28
- queues.map { |it| "queue:#{it}" }
29
- end
70
+ def startup_queue?(queue)
71
+ @startup_queues.include?(queue)
72
+ end
30
73
 
31
- def release_except(full_name)
32
- queues = restore
33
- queues.delete full_name[/queue:(.*)/, 1] if full_name
34
- Sidekiq::LimitFetch.redis_retryable do
35
- selector.release queues, namespace
36
- end
37
- end
74
+ def dynamic_exclude
75
+ @dynamic_exclude
76
+ end
38
77
 
39
- def dynamic?
40
- @dynamic
41
- end
78
+ def add(queues)
79
+ return unless queues
42
80
 
43
- def startup_queue?(queue)
44
- @startup_queues.include?(queue)
45
- end
81
+ queues.each do |queue|
82
+ next if @queues.include? queue
46
83
 
47
- def add(queues)
48
- return unless queues
49
- queues.each do |queue|
50
- unless @queues.include? queue
51
- if startup_queue?(queue)
52
- apply_process_limit_to_queue(queue)
53
- apply_limit_to_queue(queue)
84
+ if startup_queue?(queue)
85
+ apply_process_limit_to_queue(queue)
86
+ apply_limit_to_queue(queue)
87
+ end
88
+
89
+ @queues.push queue
54
90
  end
91
+ end
92
+
93
+ def remove(queues)
94
+ return unless queues
95
+
96
+ queues.each do |queue|
97
+ next unless @queues.include? queue
55
98
 
56
- @queues.push queue
99
+ clear_limits_for_queue(queue)
100
+ @queues.delete queue
101
+ Sidekiq::Queue.delete_instance(queue)
102
+ end
57
103
  end
58
- end
59
- end
60
104
 
61
- def remove(queues)
62
- return unless queues
63
- queues.each do |queue|
64
- if @queues.include? queue
65
- clear_limits_for_queue(queue)
66
- @queues.delete queue
67
- Sidekiq::Queue.delete_instance(queue)
105
+ def handle(queues)
106
+ add(queues - @queues)
107
+ remove(@queues - queues)
68
108
  end
69
- end
70
- end
71
109
 
72
- def handle(queues)
73
- add(queues - @queues)
74
- remove(@queues - queues)
75
- end
110
+ # rubocop:disable Lint/NestedMethodDefinition
111
+ def strict_order!
112
+ @queues.uniq!
113
+ def ordered_queues
114
+ @queues
115
+ end
116
+ end
76
117
 
77
- def strict_order!
78
- @queues.uniq!
79
- def ordered_queues; @queues end
80
- end
118
+ def weighted_order!
119
+ def ordered_queues
120
+ @queues.shuffle.uniq
121
+ end
122
+ end
123
+ # rubocop:enable Lint/NestedMethodDefinition
124
+
125
+ def namespace
126
+ @namespace ||= Sidekiq.redis do |it|
127
+ if it.respond_to?(:namespace) && it.namespace
128
+ "#{it.namespace}:"
129
+ else
130
+ ''
131
+ end
132
+ end
133
+ end
81
134
 
82
- def weighted_order!
83
- def ordered_queues; @queues.shuffle.uniq end
84
- end
135
+ private
85
136
 
86
- def namespace
87
- @namespace ||= Sidekiq.redis do |it|
88
- if it.respond_to?(:namespace) and it.namespace
89
- "#{it.namespace}:"
90
- else
91
- ''
137
+ def apply_process_limit_to_queues
138
+ @queues.uniq.each do |queue_name|
139
+ apply_process_limit_to_queue(queue_name)
140
+ end
92
141
  end
93
- end
94
- end
95
-
96
- private
97
142
 
98
- def apply_process_limit_to_queues
99
- @queues.uniq.each do |queue_name|
100
- apply_process_limit_to_queue(queue_name)
101
- end
102
- end
143
+ def apply_process_limit_to_queue(queue_name)
144
+ queue = Sidekiq::Queue[queue_name]
145
+ queue.process_limit = @process_limits[queue_name.to_s] || @process_limits[queue_name.to_sym]
146
+ end
103
147
 
104
- def apply_process_limit_to_queue(queue_name)
105
- queue = Sidekiq::Queue[queue_name]
106
- queue.process_limit = @process_limits[queue_name.to_s] || @process_limits[queue_name.to_sym]
107
- end
148
+ def apply_limit_to_queues
149
+ @queues.uniq.each do |queue_name|
150
+ apply_limit_to_queue(queue_name)
151
+ end
152
+ end
108
153
 
109
- def apply_limit_to_queues
110
- @queues.uniq.each do |queue_name|
111
- apply_limit_to_queue(queue_name)
112
- end
113
- end
154
+ def apply_limit_to_queue(queue_name)
155
+ queue = Sidekiq::Queue[queue_name]
114
156
 
115
- def apply_limit_to_queue(queue_name)
116
- queue = Sidekiq::Queue[queue_name]
157
+ return if queue.limit_changed?
117
158
 
118
- unless queue.limit_changed?
119
- queue.limit = @limits[queue_name.to_s] || @limits[queue_name.to_sym]
120
- end
121
- end
159
+ queue.limit = @limits[queue_name.to_s] || @limits[queue_name.to_sym]
160
+ end
122
161
 
123
- def apply_blocks_to_queues
124
- @queues.uniq.each do |queue_name|
125
- Sidekiq::Queue[queue_name].unblock
126
- end
162
+ def apply_blocks_to_queues
163
+ @queues.uniq.each do |queue_name|
164
+ Sidekiq::Queue[queue_name].unblock
165
+ end
127
166
 
128
- @blocks.to_a.each do |it|
129
- if it.is_a? Array
130
- it.each {|name| Sidekiq::Queue[name].block_except it }
131
- else
132
- Sidekiq::Queue[it].block
167
+ @blocks.to_a.each do |it|
168
+ if it.is_a? Array
169
+ it.each { |name| Sidekiq::Queue[name].block_except it }
170
+ else
171
+ Sidekiq::Queue[it].block
172
+ end
173
+ end
133
174
  end
134
- end
135
- end
136
175
 
137
- def clear_limits_for_queue(queue_name)
138
- queue = Sidekiq::Queue[queue_name]
139
- queue.clear_limits
140
- end
176
+ def clear_limits_for_queue(queue_name)
177
+ queue = Sidekiq::Queue[queue_name]
178
+ queue.clear_limits
179
+ end
141
180
 
142
- def selector
143
- Sidekiq::LimitFetch::Global::Selector
144
- end
181
+ def selector
182
+ Sidekiq::LimitFetch::Global::Selector
183
+ end
145
184
 
146
- def saved
147
- Thread.current[THREAD_KEY]
148
- end
185
+ def saved
186
+ Thread.current[THREAD_KEY]
187
+ end
149
188
 
150
- def save(queues)
151
- Thread.current[THREAD_KEY] = queues
152
- end
189
+ def save(queues)
190
+ Thread.current[THREAD_KEY] = queues
191
+ end
153
192
 
154
- def restore
155
- saved || []
156
- ensure
157
- save nil
193
+ def restore
194
+ saved || []
195
+ ensure
196
+ save nil
197
+ end
198
+ end
158
199
  end
159
200
  end
@@ -1,32 +1,36 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Sidekiq
2
- class LimitFetch::UnitOfWork < BasicFetch::UnitOfWork
3
- def initialize(queue, job)
4
- if post_6_5?
5
- super(queue, job, Sidekiq)
6
- else
7
- super
4
+ module LimitFetch
5
+ class UnitOfWork < BasicFetch::UnitOfWork
6
+ def initialize(queue, job)
7
+ if post_6_5?
8
+ super(queue, job, Sidekiq)
9
+ else
10
+ super
11
+ end
12
+ redis_retryable { Queue[queue_name].increase_busy }
8
13
  end
9
- redis_retryable { Queue[queue_name].increase_busy }
10
- end
11
14
 
12
- def acknowledge
13
- redis_retryable { Queue[queue_name].decrease_busy }
14
- redis_retryable { Queue[queue_name].release }
15
- end
15
+ def acknowledge
16
+ redis_retryable { Queue[queue_name].decrease_busy }
17
+ redis_retryable { Queue[queue_name].release }
18
+ end
16
19
 
17
- def requeue
18
- super
19
- acknowledge
20
- end
20
+ def requeue
21
+ super
22
+ acknowledge
23
+ end
21
24
 
22
- private
25
+ private
23
26
 
24
- def post_6_5?
25
- Gem::Version.new(Sidekiq::VERSION) >= Gem::Version.new('6.5.0')
26
- end
27
+ def post_6_5?
28
+ Gem::Version.new(Sidekiq::VERSION) >= Gem::Version.new('6.5.0')
29
+ end
27
30
 
28
- def redis_retryable(&block)
29
- Sidekiq::LimitFetch.redis_retryable(&block)
31
+ def redis_retryable(&block)
32
+ Sidekiq::LimitFetch.redis_retryable(&block)
33
+ end
30
34
  end
31
35
  end
32
36
  end
@@ -1,76 +1,95 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'forwardable'
2
4
  require 'sidekiq'
3
5
  require 'sidekiq/manager'
4
6
  require 'sidekiq/api'
5
7
 
6
- module Sidekiq::LimitFetch
7
- autoload :UnitOfWork, 'sidekiq/limit_fetch/unit_of_work'
8
+ module Sidekiq
9
+ module LimitFetch
10
+ autoload :UnitOfWork, 'sidekiq/limit_fetch/unit_of_work'
8
11
 
9
- require_relative 'limit_fetch/instances'
10
- require_relative 'limit_fetch/queues'
11
- require_relative 'limit_fetch/global/semaphore'
12
- require_relative 'limit_fetch/global/selector'
13
- require_relative 'limit_fetch/global/monitor'
14
- require_relative 'extensions/queue'
15
- require_relative 'extensions/manager'
12
+ require_relative 'limit_fetch/instances'
13
+ require_relative 'limit_fetch/queues'
14
+ require_relative 'limit_fetch/global/semaphore'
15
+ require_relative 'limit_fetch/global/selector'
16
+ require_relative 'limit_fetch/global/monitor'
17
+ require_relative 'extensions/queue'
18
+ require_relative 'extensions/manager'
16
19
 
17
- TIMEOUT = Sidekiq::BasicFetch::TIMEOUT
20
+ TIMEOUT = Sidekiq::BasicFetch::TIMEOUT
18
21
 
19
- extend self
22
+ extend self
20
23
 
21
- def new(_)
22
- self
23
- end
24
+ def post_7?
25
+ @post_7 ||= Gem::Version.new(Sidekiq::VERSION) >= Gem::Version.new('7.0.0')
26
+ end
24
27
 
25
- def retrieve_work
26
- queue, job = redis_brpop(Queues.acquire)
27
- Queues.release_except(queue)
28
- UnitOfWork.new(queue, job) if job
29
- end
28
+ def post_6_5?
29
+ @post_6_5 ||= Gem::Version.new(Sidekiq::VERSION) >= Gem::Version.new('6.5.0')
30
+ end
30
31
 
31
- def config
32
- # Post 6.5, Sidekiq.options is deprecated and replaced with passing Sidekiq directly
33
- post_6_5? ? Sidekiq : Sidekiq.options
34
- end
32
+ RedisBaseConnectionError = post_7? ? RedisClient::ConnectionError : Redis::BaseConnectionError
33
+ RedisCommandError = post_7? ? RedisClient::CommandError : Redis::CommandError
35
34
 
36
- # Backwards compatibility for sidekiq v6.1.0
37
- # @see https://github.com/mperham/sidekiq/pull/4602
38
- def bulk_requeue(*args)
39
- if Sidekiq::BasicFetch.respond_to?(:bulk_requeue) # < 6.1.0
40
- Sidekiq::BasicFetch.bulk_requeue(*args)
41
- else # 6.1.0+
42
- Sidekiq::BasicFetch.new(config).bulk_requeue(*args)
35
+ def new(_)
36
+ self
43
37
  end
44
- end
45
38
 
46
- def redis_retryable
47
- yield
48
- rescue Redis::BaseConnectionError
49
- sleep TIMEOUT
50
- retry
51
- rescue Redis::CommandError => error
52
- # If Redis was restarted and is still loading its snapshot,
53
- # then we should treat this as a temporary connection error too.
54
- if error.message =~ /^LOADING/
39
+ def retrieve_work
40
+ queue, job = redis_brpop(Queues.acquire)
41
+ Queues.release_except(queue)
42
+ UnitOfWork.new(queue, job) if job
43
+ end
44
+
45
+ def config
46
+ # Post 6.5, Sidekiq.options is deprecated and replaced with passing Sidekiq directly
47
+ post_6_5? ? Sidekiq : Sidekiq.options
48
+ end
49
+
50
+ # Backwards compatibility for sidekiq v6.1.0
51
+ # @see https://github.com/mperham/sidekiq/pull/4602
52
+ def bulk_requeue(*args)
53
+ if Sidekiq::BasicFetch.respond_to?(:bulk_requeue) # < 6.1.0
54
+ Sidekiq::BasicFetch.bulk_requeue(*args)
55
+ else # 6.1.0+
56
+ Sidekiq::BasicFetch.new(post_7? ? Sidekiq.default_configuration.default_capsule : config).bulk_requeue(*args)
57
+ end
58
+ end
59
+
60
+ def redis_retryable
61
+ yield
62
+ rescue RedisBaseConnectionError
55
63
  sleep TIMEOUT
56
64
  retry
57
- else
58
- raise
59
- end
60
- end
65
+ rescue RedisCommandError => e
66
+ # If Redis was restarted and is still loading its snapshot,
67
+ # then we should treat this as a temporary connection error too.
68
+ raise unless e.message =~ /^LOADING/
61
69
 
62
- private
70
+ sleep TIMEOUT
71
+ retry
72
+ end
63
73
 
64
- def post_6_5?
65
- @post_6_5 ||= Gem::Version.new(Sidekiq::VERSION) >= Gem::Version.new('6.5.0')
66
- end
74
+ private
67
75
 
68
- def redis_brpop(queues)
69
- if queues.empty?
70
- sleep TIMEOUT # there are no queues to handle, so lets sleep
71
- [] # and return nothing
72
- else
73
- redis_retryable { Sidekiq.redis { |it| it.brpop *queues, timeout: TIMEOUT } }
76
+ # rubocop:disable Metrics/MethodLength
77
+ def redis_brpop(queues)
78
+ if queues.empty?
79
+ sleep TIMEOUT # there are no queues to handle, so lets sleep
80
+ [] # and return nothing
81
+ else
82
+ redis_retryable do
83
+ Sidekiq.redis do |it|
84
+ if post_7?
85
+ it.blocking_call(false, 'brpop', *queues, TIMEOUT)
86
+ else
87
+ it.brpop(*queues, timeout: TIMEOUT)
88
+ end
89
+ end
90
+ end
91
+ end
74
92
  end
93
+ # rubocop:enable Metrics/MethodLength
75
94
  end
76
95
  end
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'sidekiq/limit_fetch'
@@ -1,25 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'English'
1
4
  Gem::Specification.new do |gem|
2
5
  gem.name = 'sidekiq-limit_fetch'
3
- gem.version = '4.3.2'
6
+ gem.version = '4.4.1'
4
7
  gem.license = 'MIT'
5
- gem.authors = ['Dean Perry', 'brainopia']
8
+ gem.authors = ['Dean Perry']
6
9
  gem.email = 'dean@deanpcmad.com'
7
10
  gem.summary = 'Sidekiq strategy to support queue limits'
8
11
  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."
12
+ gem.description = 'Sidekiq strategy to restrict number of workers which are able to run specified ' \
13
+ 'queues simultaneously.'
10
14
 
11
- gem.metadata["homepage_uri"] = gem.homepage
12
- gem.metadata["source_code_uri"] = "https://github.com/deanpcmad/sidekiq-limit_fetch"
13
- gem.metadata["changelog_uri"] = "https://github.com/deanpcmad/sidekiq-limit_fetch/blob/master/CHANGELOG.md"
15
+ gem.metadata['homepage_uri'] = gem.homepage
16
+ gem.metadata['source_code_uri'] = 'https://github.com/deanpcmad/sidekiq-limit_fetch'
17
+ gem.metadata['changelog_uri'] = 'https://github.com/deanpcmad/sidekiq-limit_fetch/blob/master/CHANGELOG.md'
18
+ gem.metadata['rubygems_mfa_required'] = 'true'
14
19
 
15
- gem.files = `git ls-files`.split($/)
16
- gem.test_files = gem.files.grep %r{^spec/}
17
- gem.require_paths = %w(lib)
20
+ gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
21
+ gem.require_paths = %w[lib]
18
22
 
19
- gem.add_dependency 'sidekiq', '>= 4'
20
- gem.add_dependency 'redis', '>= 4.6.0'
21
- gem.add_development_dependency 'redis-namespace', '~> 1.5', '>= 1.5.2'
23
+ gem.required_ruby_version = '>= 2.7.0'
24
+
25
+ gem.add_dependency 'sidekiq', '>= 6'
22
26
  gem.add_development_dependency 'appraisal'
23
- gem.add_development_dependency 'rspec'
24
27
  gem.add_development_dependency 'rake'
28
+ gem.add_development_dependency 'redis-namespace', '~> 1.5', '>= 1.5.2'
29
+ gem.add_development_dependency 'rspec'
30
+ gem.add_development_dependency 'rubocop'
31
+ gem.add_development_dependency 'simplecov'
25
32
  end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ RSpec.describe Sidekiq::Manager do
4
+ let(:capsule_or_options) do
5
+ if Sidekiq::LimitFetch.post_7?
6
+ Sidekiq.default_configuration.default_capsule
7
+ elsif Sidekiq::LimitFetch.post_6_5?
8
+ Sidekiq
9
+ else
10
+ Sidekiq.options
11
+ end
12
+ end
13
+
14
+ it 'can be instantiated' do
15
+ expect(described_class).to be < Sidekiq::Manager::InitLimitFetch
16
+ manager = described_class.new(capsule_or_options)
17
+ expect(manager).to respond_to(:start)
18
+ end
19
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec.describe Sidekiq::Queue do
2
4
  context 'singleton' do
3
5
  shared_examples :constructor do