Class: Chewy::Strategy::ResqueAtomic
- Inherits:
-
ResqueBase
- Object
- Base
- ResqueBase
- Chewy::Strategy::ResqueAtomic
- Defined in:
- lib/chewy/strategy/resque_atomic.rb
Instance Method Summary collapse
-
#initialize ⇒ ResqueAtomic
constructor
A new instance of ResqueAtomic.
- #leave ⇒ Object
- #update(type, objects, options = {}) ⇒ Object
Methods inherited from ResqueBase
Constructor Details
#initialize ⇒ ResqueAtomic
Returns a new instance of ResqueAtomic.
4 5 6 |
# File 'lib/chewy/strategy/resque_atomic.rb', line 4 def initialize @stash = {} end |
Instance Method Details
#leave ⇒ Object
13 14 15 16 17 |
# File 'lib/chewy/strategy/resque_atomic.rb', line 13 def leave @stash.all? do |type, ids| enqueue(type, ids) end end |
#update(type, objects, options = {}) ⇒ Object
8 9 10 11 |
# File 'lib/chewy/strategy/resque_atomic.rb', line 8 def update(type, objects, = {}) @stash[type] ||= [] @stash[type] |= type.adapter.identify(objects) end |