Class: ActiveJob::QueueAdapters::PikaQueRails5
- Inherits:
-
Object
- Object
- ActiveJob::QueueAdapters::PikaQueRails5
- Defined in:
- lib/active_job/queue_adapters/pika_que_adapter.rb
Instance Method Summary collapse
-
#enqueue(job) ⇒ Object
:nodoc:.
-
#enqueue_at(job, timestamp) ⇒ Object
:nodoc:.
-
#initialize ⇒ PikaQueRails5
constructor
A new instance of PikaQueRails5.
Constructor Details
#initialize ⇒ PikaQueRails5
Returns a new instance of PikaQueRails5.
35 36 37 |
# File 'lib/active_job/queue_adapters/pika_que_adapter.rb', line 35 def initialize @monitor = Monitor.new end |
Instance Method Details
#enqueue(job) ⇒ Object
:nodoc:
39 40 41 42 43 |
# File 'lib/active_job/queue_adapters/pika_que_adapter.rb', line 39 def enqueue(job) #:nodoc: @monitor.synchronize do PikaQue::RailsWorker.enqueue job.serialize, to_queue: job.queue_name, priority: job.priority end end |
#enqueue_at(job, timestamp) ⇒ Object
:nodoc:
45 46 47 48 49 |
# File 'lib/active_job/queue_adapters/pika_que_adapter.rb', line 45 def enqueue_at(job, ) #:nodoc: @monitor.synchronize do PikaQue::RailsWorker.enqueue_at job.serialize, , routing_key: job.queue_name end end |