Module: BackgroundJobs::Sidekiq

Defined in:
lib/background_jobs/strategies/sidekiq/setup.rb,
lib/background_jobs/strategies/sidekiq/job_queue.rb,
lib/background_jobs/strategies/sidekiq/job_adapter.rb,
lib/background_jobs/strategies/sidekiq/job_attributes_adapter.rb

Defined Under Namespace

Classes: ArrayAttribute, Attribute, AttributeFactory, Attributes, HashAttribute, JobAdapter, JobAttributesAdapter, JobQueue, StringAttribute

Class Method Summary collapse

Class Method Details

.register_job_callback(job_metadata) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/background_jobs/strategies/sidekiq/setup.rb', line 14

def self.register_job_callback()
  options = .options

  BackgroundJobs::QueueService.enqueue(
    .name, [], :in => options[:schedule], :unique => true
  ) if options[:schedule]
end

.setup(options) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/background_jobs/strategies/sidekiq/setup.rb', line 6

def self.setup(options)
  ::Sidekiq.configure_server do |config|
    config.redis = options[:redis] if options[:redis]
  end

  BackgroundJobs.job_registry.register_callback = method(:register_job_callback)
end