Sha256: 4f3f60fe183b8dee203d7973772be5e43ac48679852fdad22d0565607a62a9e5

Contents?: true

Size: 796 Bytes

Versions: 9

Compression:

Stored size: 796 Bytes

Contents

require 'alephant/logger'

require 'alephant/broker/request'
require 'alephant/broker/response'
require 'alephant/broker/request/factory'
require 'alephant/broker/response/factory'

module Alephant
  module Broker
    module Request
      class Handler
        extend Logger

        def self.request_for(env)
          Request::Factory.request_for env
        end

        def self.response_for(request)
          Response::Factory.response_for request
        end

        def self.process(env)
          begin
            response_for request_for(env)
          rescue Exception => e
            logger.warn("Broker.requestHandler.process: Exception raised (#{e.message}, #{e.backtrace.join('\n')})")
            Response::Factory.error
          end
        end

      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
alephant-broker-1.2.1 lib/alephant/broker/request/handler.rb
alephant-broker-1.2.0 lib/alephant/broker/request/handler.rb
alephant-broker-1.1.3 lib/alephant/broker/request/handler.rb
alephant-broker-1.1.2 lib/alephant/broker/request/handler.rb
alephant-broker-1.1.1 lib/alephant/broker/request/handler.rb
alephant-broker-1.1.0 lib/alephant/broker/request/handler.rb
alephant-broker-1.0.5 lib/alephant/broker/request/handler.rb
alephant-broker-1.0.4 lib/alephant/broker/request/handler.rb
alephant-broker-1.0.3 lib/alephant/broker/request/handler.rb