Sha256: 1b815ceca4b9daae406c81894c994c43f423c9ad7b8e26f5798e84feca3174d2

Contents?: true

Size: 686 Bytes

Versions: 9

Compression:

Stored size: 686 Bytes

Contents

# frozen_string_literal: true

require "lamian"
require "active_job"

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

9 entries across 9 versions & 1 rubygems

Version Path
rabbit_messaging-1.1.0 lib/rabbit/receiving/job.rb
rabbit_messaging-1.0.0 lib/rabbit/receiving/job.rb
rabbit_messaging-0.15.0 lib/rabbit/receiving/job.rb
rabbit_messaging-0.13.0 lib/rabbit/receiving/job.rb
rabbit_messaging-0.12.1 lib/rabbit/receiving/job.rb
rabbit_messaging-0.12.0 lib/rabbit/receiving/job.rb
rabbit_messaging-0.11.0 lib/rabbit/receiving/job.rb
rabbit_messaging-0.10.0 lib/rabbit/receiving/job.rb
rabbit_messaging-0.9.0 lib/rabbit/receiving/job.rb