Class: WithEvents::Worker

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::Worker, Validator
Defined in:
lib/with_events/worker.rb

Constant Summary

Constants included from Validator

Validator::DAILY_APPEARANCE, Validator::HOURLY_APPEARANCE

Instance Method Summary collapse

Methods included from Validator

#valid_event?

Instance Method Details

#perform(stream, event_name, appearance) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/with_events/worker.rb', line 12

def perform(stream, event_name, appearance)
  events(stream, event_name, appearance).each do |event|
    event.options[:batch].call.each do |resource|
      call(event, resource) if may_call?(event, resource)
    end
  end

  reraise_last_exception
end