Class: ActiveJob::QueueAdapters::SneakersAdapter
- Inherits:
-
AbstractAdapter
- Object
- AbstractAdapter
- ActiveJob::QueueAdapters::SneakersAdapter
- Defined in:
- lib/active_job/queue_adapters/sneakers_adapter.rb
Overview
Sneakers adapter for Active Job
To use Sneakers set the queue_adapter config to :sneakers
.
Rails.application.config.active_job.queue_adapter = :sneakers
Defined Under Namespace
Classes: JobWrapper
Instance Method Summary collapse
- #enqueue(job) ⇒ Object
- #enqueue_at(job, timestamp) ⇒ Object
-
#initialize ⇒ SneakersAdapter
constructor
A new instance of SneakersAdapter.
Constructor Details
#initialize ⇒ SneakersAdapter
Returns a new instance of SneakersAdapter.
13 14 15 |
# File 'lib/active_job/queue_adapters/sneakers_adapter.rb', line 13 def initialize @monitor = Monitor.new end |
Instance Method Details
#enqueue(job) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/active_job/queue_adapters/sneakers_adapter.rb', line 17 def enqueue(job) @monitor.synchronize do JobWrapper.from_queue job.queue_name JobWrapper.enqueue ActiveSupport::JSON.encode(job.serialize) end end |
#enqueue_at(job, timestamp) ⇒ Object
24 25 26 |
# File 'lib/active_job/queue_adapters/sneakers_adapter.rb', line 24 def enqueue_at(job, ) raise NotImplementedError, 'This queueing backend does not support scheduling jobs.' end |