Class: Sidekiq::Portal::JobRegistry Private
- Inherits:
-
Object
- Object
- Sidekiq::Portal::JobRegistry
- Defined in:
- lib/portal/job_registry.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
- #each(&block) {|job| ... } ⇒ Enumerable private
- #include?(job_klass) ⇒ Boolean private
- #initialize ⇒ void constructor private
- #register(job) ⇒ void private
- #resolve(job_klass) ⇒ Sidekiq::Portal::Job private
Constructor Details
Instance Method Details
#each(&block) {|job| ... } ⇒ Enumerable
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
56 57 58 59 60 |
# File 'lib/portal/job_registry.rb', line 56 def each(&block) thread_safe do block_given? ? jobs.each_value(&block) : jobs.each_value end end |
#include?(job_klass) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
45 46 47 |
# File 'lib/portal/job_registry.rb', line 45 def include?(job_klass) thread_safe { jobs.key?(job_klass) } end |
#register(job) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
20 21 22 |
# File 'lib/portal/job_registry.rb', line 20 def register(job) thread_safe { jobs[job.klass] = job } end |
#resolve(job_klass) ⇒ Sidekiq::Portal::Job
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/portal/job_registry.rb', line 29 def resolve(job_klass) thread_safe do jobs.fetch(job_klass) do raise( Sidekiq::Portal::NonScheduledJobClassError, "Trying to work with non-scheduled job class \"#{job_klass}\"" ) end end end |