class Tantot::Strategy::Chewy::Worker

Public Instance Methods

perform(agent_id, chew_strategy, changes_by_model) click to toggle source
# File lib/tantot/strategy/chewy.rb, line 7
def perform(agent_id, chew_strategy, changes_by_model)
  agent = Tantot.agent_registry.agent(agent_id)
  raise AgentNotFound.new("No registered agent with id #{id}") unless agent

  ::Chewy.strategy(chewy_strategy) do
    agent.perform(Tantot::Strategy::Sidekiq.unmarshal(changes_by_model))
  end
end