Sha256: fe930dd52611acdf24608271752d02d207eda1a7f5fdfba34a6928c01a6f9e9c

Contents?: true

Size: 665 Bytes

Versions: 1

Compression:

Stored size: 665 Bytes

Contents

# frozen_string_literal: true

require "lamian"

require "rabbit"
require "rabbit/receiving"
require "rabbit/receiving/message"
require "rabbit/receiving/handler_resolver"
require "rabbit/receiving/malformed_message"

class Rabbit::Receiving::Job < ActiveJob::Base
  def perform(message, arguments)
    Lamian.run do
      message = Rabbit::Receiving::Message.build(message, arguments)
      handler = Rabbit::Receiving::HandlerResolver.handler_for(message)
      handler.new(message).call
    rescue Rabbit::Receiving::MalformedMessage => error
      raise if Rabbit.config.environment == :test
      Rabbit.config.exception_notifier.call(error)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rabbit_messaging-0.8.1 lib/rabbit/receiving/job.rb