blob: 30b82338200055068ff7c61dafa65c00c475efb1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
class QueuedJob < Struct.new(:event, :payload)
def perform
handlers_for(event).each { |handler| handler.handle(payload) }
end
def error(job, exception)
ExceptionNotifier.notify_exception(exception) unless Rails.env.test?
end
private
def handlers_for(event)
container.resolve_all(:message_handler).find_all do |handler|
handler.handles?(event)
end
end
def container
@container ||= Spank::IOC.resolve(:container)
end
end
|