It's common to have code like this:
SentryJob = Struct.new(:event) do
def perform
Raven.send_event(event)
end
end
Raven.configure do |config|
config.async = lambda { |event|
Delayed::Job.enqueue SentryJob.new(event.to_hash)
}
end
event.to_hash can contain an anonymous module, which cannot be dumped to YAML formats for use in a job processor.