Class: Gitlab::SidekiqConfig::DummyWorker
- Inherits:
-
Object
- Object
- Gitlab::SidekiqConfig::DummyWorker
- Defined in:
- lib/gitlab/sidekiq_config/dummy_worker.rb
Overview
For queues that don’t have explicit workers - default and mailers
Constant Summary collapse
- ATTRIBUTE_METHODS =
{ name: :name, has_external_dependencies: :worker_has_external_dependencies?, urgency: :get_urgency, resource_boundary: :get_worker_resource_boundary, idempotent: :idempotent?, weight: :get_weight, tags: :get_tags }.freeze
Instance Method Summary collapse
- #context_for_arguments ⇒ Object
- #feature_category_not_owned? ⇒ Boolean
- #generated_queue_name ⇒ Object
-
#get_feature_category ⇒ Object
All dummy workers are unowned; get the feature category from the context if available.
- #get_worker_context ⇒ Object
-
#initialize(attributes = {}) ⇒ DummyWorker
constructor
A new instance of DummyWorker.
- #queue ⇒ Object
- #queue_namespace ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ DummyWorker
Returns a new instance of DummyWorker.
17 18 19 |
# File 'lib/gitlab/sidekiq_config/dummy_worker.rb', line 17 def initialize(attributes = {}) @attributes = attributes end |
Instance Method Details
#context_for_arguments ⇒ Object
47 48 49 |
# File 'lib/gitlab/sidekiq_config/dummy_worker.rb', line 47 def context_for_arguments(*) nil end |
#feature_category_not_owned? ⇒ Boolean
39 40 41 |
# File 'lib/gitlab/sidekiq_config/dummy_worker.rb', line 39 def feature_category_not_owned? true end |
#generated_queue_name ⇒ Object
21 22 23 |
# File 'lib/gitlab/sidekiq_config/dummy_worker.rb', line 21 def generated_queue_name @attributes[:queue] end |
#get_feature_category ⇒ Object
All dummy workers are unowned; get the feature category from the context if available.
35 36 37 |
# File 'lib/gitlab/sidekiq_config/dummy_worker.rb', line 35 def get_feature_category Gitlab::ApplicationContext.current_context_attribute('meta.feature_category') || :not_owned end |
#get_worker_context ⇒ Object
43 44 45 |
# File 'lib/gitlab/sidekiq_config/dummy_worker.rb', line 43 def get_worker_context nil end |
#queue ⇒ Object
25 26 27 |
# File 'lib/gitlab/sidekiq_config/dummy_worker.rb', line 25 def queue @attributes[:queue] end |
#queue_namespace ⇒ Object
29 30 31 |
# File 'lib/gitlab/sidekiq_config/dummy_worker.rb', line 29 def queue_namespace nil end |