app/models/agent.rb
def async_receive(agent_id, event_ids)
      agent = Agent.find(agent_id)
      begin
        agent.receive(Event.where(:id => event_ids))
        agent.last_receive_at = Time.now
        agent.save!
      rescue => e
        agent.error "Exception during receive: #{e.message} -- #{e.backtrace}"
        raise
      end
    end
# Given an Agent id and an array of Event ids, load the Agent, call #receive on it with the Event objects, and then
# save it with an updated `last_receive_at` timestamp.
#
# This method is tagged with `handle_asynchronously` and will be delayed and run with delayed_job.  It accepts Agent
# and Event ids instead of a literal ActiveRecord models because it is preferable to serialize delayed_jobs with ids.
Given an Agent id and an array of Event ids, load the Agent, call #receive on it with the Event objects, and then
save it with an updated `last_receive_at` timestamp.

This method is tagged with `handle_asynchronously` and will be delayed and run with delayed_job.  It accepts Agent
and Event ids instead of a literal ActiveRecord models because it is preferable to serialize delayed_jobs with ids.
Given an Agent id and an array of Event ids load the Agent call #receive on it with the Event objects and then save it with an updated ` last_receive_at ` timestamp . This method is tagged with ` handle_asynchronously ` and will be delayed and run with delayed_job . It accepts Agent and Event ids instead of a literal ActiveRecord models because it is preferable to serialize delayed_jobs with ids .
def async_receive(agent_id, event_ids)
      agent = Agent.find(agent_id)
      begin
        agent.receive(Event.where(:id => event_ids))
        agent.last_receive_at = Time.now
        agent.save!
      rescue => e
        agent.error "Exception during receive: #{e.message} -- #{e.backtrace}"
        raise
      end
    end
def async_receive ( agent_id , event_ids ) agent = Agent . find ( agent_id ) begin agent . receive ( Event . where ( :id => event_ids ) ) agent . last_receive_at = Time . now agent . save! rescue => e agent . error "Exception during receive: #{e.message} -- #{e.backtrace}" raise end end
Given an Agent id and an array of Event ids, load the Agent, call #receive on it with the Event objects, and then
save it with an updated `last_receive_at` timestamp.
Given an Agent id and an array of Event ids load the Agent call #receive on it with the Event objects and then save it with an updated ` last_receive_at ` timestamp .
agent_id
event_ids