Class: ActiveJob::QueueAdapters::QueAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/que/active_job/extensions.rb,
lib/que/active_job/extensions.rb

Defined Under Namespace

Classes: JobWrapper

Instance Method Summary collapse

Instance Method Details

#enqueue(job) ⇒ Object



120
121
122
123
124
125
# File 'lib/que/active_job/extensions.rb', line 120

def enqueue(job)
  job_options = { priority: job.priority, queue: job.queue_name }
  que_job = JobWrapper.enqueue job.serialize, **job_options
  job.provider_job_id = que_job.attrs["job_id"]
  que_job
end

#enqueue_at(job, timestamp) ⇒ Object



127
128
129
130
131
132
# File 'lib/que/active_job/extensions.rb', line 127

def enqueue_at(job, timestamp)
  job_options = { priority: job.priority, queue: job.queue_name, run_at: Time.at(timestamp) }
  que_job = JobWrapper.enqueue job.serialize, **job_options
  job.provider_job_id = que_job.attrs["job_id"]
  que_job
end