class Gateway::Base

Attributes

name[R]
options[R]

Public Class Methods

new(name, opts) click to toggle source
# File lib/gateway/base.rb, line 22
def initialize(name, opts)
  @name = name
  @options = opts
end

Protected Instance Methods

bad_gateway_errors(action) click to toggle source
# File lib/gateway/base.rb, line 29
def bad_gateway_errors(action)
  errors_for(action, :bad_gateway)
end
execute(action, req, opts={}, &block) click to toggle source
# File lib/gateway/base.rb, line 53
def execute(action, req, opts={}, &block)
  with_connection(opts) do |conn|
    with_retry(action, opts) do
      with_error_handle(action, conn, opts) do
        with_new_relic(opts) do
          with_perf(action, req, opts) do
            with_timeout(opts) do
              block.call(conn)
            end
          end
        end
      end
    end
  end
end
retry_errors(action) click to toggle source
# File lib/gateway/base.rb, line 37
def retry_errors(action)
  errors_for(action, :retry)
end
run_bad_gateway_callbacks(action) click to toggle source
# File lib/gateway/base.rb, line 41
def run_bad_gateway_callbacks(action)
  run_callbacks_for(action, :bad_gateway)
end
run_retry_callbacks(action) click to toggle source
# File lib/gateway/base.rb, line 49
def run_retry_callbacks(action)
  run_callbacks_for(action, :retry)
end
run_timeout_callbacks(action) click to toggle source
# File lib/gateway/base.rb, line 45
def run_timeout_callbacks(action)
  run_callbacks_for(action, :timeout)
end
timeout_errors(action) click to toggle source
# File lib/gateway/base.rb, line 33
def timeout_errors(action)
  errors_for(action, :timeout)
end