Class: Sunspot::Queue::DelayedJob::Backend
- Inherits:
-
Object
- Object
- Sunspot::Queue::DelayedJob::Backend
- Defined in:
- lib/sunspot/queue/delayed_job/backend.rb
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
Instance Method Summary collapse
- #enqueue(job) ⇒ Object
- #index(klass, id) ⇒ Object
-
#initialize(configuration = Sunspot::Queue.configuration) ⇒ Backend
constructor
A new instance of Backend.
- #remove(klass, id) ⇒ Object
Constructor Details
#initialize(configuration = Sunspot::Queue.configuration) ⇒ Backend
Returns a new instance of Backend.
9 10 11 |
# File 'lib/sunspot/queue/delayed_job/backend.rb', line 9 def initialize(configuration = Sunspot::Queue.configuration) @configuration = configuration end |
Instance Attribute Details
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
7 8 9 |
# File 'lib/sunspot/queue/delayed_job/backend.rb', line 7 def configuration @configuration end |
Instance Method Details
#enqueue(job) ⇒ Object
13 14 15 |
# File 'lib/sunspot/queue/delayed_job/backend.rb', line 13 def enqueue(job) Delayed::Job.enqueue(job) end |
#index(klass, id) ⇒ Object
17 18 19 |
# File 'lib/sunspot/queue/delayed_job/backend.rb', line 17 def index(klass, id) enqueue(index_job.new(klass, id)) end |
#remove(klass, id) ⇒ Object
21 22 23 |
# File 'lib/sunspot/queue/delayed_job/backend.rb', line 21 def remove(klass, id) enqueue(removal_job.new(klass, id)) end |