Sha256: 344e85de300ffb925e595fefef77184c0e4d020f9e4191be6a2669a17e0f36f8

Contents?: true

Size: 436 Bytes

Versions: 10

Compression:

Stored size: 436 Bytes

Contents

class Freddy
  class MessageHandler
    attr_reader :correlation_id

    def initialize(adapter, delivery)
      @adapter = adapter
      @delivery = delivery
      @correlation_id = @delivery.correlation_id
    end

    def success(response = nil)
      @adapter.success(@delivery.reply_to, response)
    end

    def error(error = {error: "Couldn't process message"})
      @adapter.error(@delivery.reply_to, error)
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
freddy-0.5.3 lib/freddy/message_handler.rb
freddy-0.5.2 lib/freddy/message_handler.rb
freddy-jruby-0.5.1 lib/freddy/message_handler.rb
freddy-0.5.1 lib/freddy/message_handler.rb
freddy-jruby-0.5.0 lib/freddy/message_handler.rb
freddy-0.5.0 lib/freddy/message_handler.rb
freddy-jruby-0.4.9 lib/freddy/message_handler.rb
freddy-0.4.9 lib/freddy/message_handler.rb
freddy-0.4.8 lib/freddy/message_handler.rb
freddy-0.4.7 lib/freddy/message_handler.rb