Class: ActiveJob::QueueAdapters::FunktorAdapter
- Inherits:
-
Object
- Object
- ActiveJob::QueueAdapters::FunktorAdapter
- Defined in:
- lib/active_job/queue_adapters/funktor_adapter.rb
Overview
Funktor adapter for Active Job
To use Funktor set the queue_adapter config to :funktor
.
Rails.application.config.active_job.queue_adapter = :funktor
Defined Under Namespace
Classes: JobWrapper
Instance Method Summary collapse
-
#enqueue(job) ⇒ Object
:nodoc:.
-
#enqueue_at(job, timestamp) ⇒ Object
:nodoc:.
Instance Method Details
#enqueue(job) ⇒ Object
:nodoc:
14 15 16 17 18 19 20 21 22 |
# File 'lib/active_job/queue_adapters/funktor_adapter.rb', line 14 def enqueue(job) # :nodoc: job.provider_job_id = Funktor.job_pusher.push({ "worker" => JobWrapper.to_s, "wrapped" => job.class, "queue" => job.class.work_queue, "perform_at" => Time.now.utc, "worker_params" => [ job.serialize ] }) end |
#enqueue_at(job, timestamp) ⇒ Object
:nodoc:
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/active_job/queue_adapters/funktor_adapter.rb', line 24 def enqueue_at(job, ) # :nodoc: time = Time.at().utc job.provider_job_id = Funktor.job_pusher.push({ "worker" => JobWrapper.to_s, "wrapped" => job.class, "queue" => job.class.work_queue, "perform_at" => time, "worker_params" => [ job.serialize ] }) end |