Class: Sidekiq::Portal::JobManager Private
- Inherits:
-
Object
- Object
- Sidekiq::Portal::JobManager
- Defined in:
- lib/portal/job_manager.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.
Defined Under Namespace
Classes: Builder
Instance Method Summary collapse
- #each_job(&block) {|job| ... } ⇒ Enumerable private
- #each_time_point(&block) {|time| ... } ⇒ Enumerable private
- #initialize(job_registry) ⇒ void constructor private
- #resolve(job_klass) ⇒ Sidekiq::Portal::Job private
- #runnable?(job_klass) ⇒ void private
- #time_points ⇒ Array<Time> private
Constructor Details
#initialize(job_registry) ⇒ 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.
13 14 15 |
# File 'lib/portal/job_manager.rb', line 13 def initialize(job_registry) @job_registry = job_registry end |
Instance Method Details
#each_job(&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.
41 42 43 |
# File 'lib/portal/job_manager.rb', line 41 def each_job(&block) block_given? ? job_registry.each(&block) : job_registry.each end |
#each_time_point(&block) {|time| ... } ⇒ 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.
67 68 69 |
# File 'lib/portal/job_manager.rb', line 67 def each_time_point(&block) block_given? ? time_points.each(&block) : time_points.each 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.
30 31 32 |
# File 'lib/portal/job_manager.rb', line 30 def resolve(job_klass) job_registry.resolve(job_klass) end |
#runnable?(job_klass) ⇒ 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.
22 23 24 |
# File 'lib/portal/job_manager.rb', line 22 def runnable?(job_klass) job_registry.include?(job_klass) end |
#time_points ⇒ Array<Time>
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.
49 50 51 52 53 54 55 56 57 |
# File 'lib/portal/job_manager.rb', line 49 def time_points each_job .map(&:timeline) .map!(&:time_points) .tap(&:flatten!) .tap(&:sort!) .tap(&:uniq!) .tap { |points| points.select! { |point| point <= Time.current } } end |