Class: ActiveJob::QueueAdapters::SidekiqAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/active_job/queue_adapters/sidekiq_adapter.rb

Defined Under Namespace

Classes: JobWrapper

Class Method Summary collapse

Class Method Details

.enqueue(job) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/active_job/queue_adapters/sidekiq_adapter.rb', line 7

def enqueue(job)
  #Sidekiq::Client does not support symbols as keys
  Sidekiq::Client.push \
    'class' => JobWrapper,
    'queue' => job.queue_name,
    'args'  => [ job.serialize ],
    'retry' => true
end

.enqueue_at(job, timestamp) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/active_job/queue_adapters/sidekiq_adapter.rb', line 16

def enqueue_at(job, timestamp)
  Sidekiq::Client.push \
    'class' => JobWrapper,
    'queue' => job.queue_name,
    'args'  => [ job.serialize ],
    'retry' => true,
    'at'    => timestamp
end