Class: Chewy::Strategy::Sidekiq
- Defined in:
- lib/chewy/strategy/sidekiq.rb
Overview
The strategy works the same way as atomic, but performs async index update driven by sidekiq
Chewy.strategy(:sidekiq) do
User.all.map(&:save) # Does nothing here
Post.all.map(&:save) # And here
# It imports all the changed users and posts right here
end
Defined Under Namespace
Classes: Worker
Instance Method Summary collapse
Methods inherited from Atomic
Methods inherited from Base
Constructor Details
This class inherits a constructor from Chewy::Strategy::Atomic
Instance Method Details
#leave ⇒ Object
21 22 23 |
# File 'lib/chewy/strategy/sidekiq.rb', line 21 def leave @stash.all? { |type, ids| Chewy::Strategy::Sidekiq::Worker.perform_async(type.name, ids) } end |