def balancer
      @balancer ||= RightSupport::Net::RequestBalancer.new(
        hostnames_ips,
        :policy => RightSupport::Net::LB::Sticky,
        :retry  => RETRY_MAX_ATTEMPTS,
        :fatal  => lambda do |e|
          if RightSupport::Net::RequestBalancer::DEFAULT_FATAL_EXCEPTIONS.any? { |c| e.is_a?(c) }
            true
          elsif e.respond_to?(:http_code) && (e.http_code != nil)
            (e.http_code >= 400 && e.http_code < 500) && (e.http_code != 408 && e.http_code != 500 )
          else
            false
          end
        end
      )
    end
def balancer
      @balancer ||= RightSupport::Net::RequestBalancer.new(
        hostnames_ips,
        :policy => RightSupport::Net::LB::Sticky,
        :retry  => RETRY_MAX_ATTEMPTS,
        :fatal  => lambda do |e|
          if RightSupport::Net::RequestBalancer::DEFAULT_FATAL_EXCEPTIONS.any? { |c| e.is_a?(c) }
            true
          elsif e.respond_to?(:http_code) && (e.http_code != nil)
            (e.http_code >= 400 && e.http_code < 500) && (e.http_code != 408 && e.http_code != 500 )
          else
            false
          end
        end
      )
    end
Create and return a RequestBalancer instance

 The purpose of this method is to create a RequestBalancer that will be used
 to service all 'download' requests.  Once a valid endpoint is found, the
 balancer will 'stick' with it. It will consider a response of '408: RequestTimeout' and
 '500: InternalServerError' as retryable exceptions and all other HTTP error codes to
 indicate a fatal exception that should abort the load-balanced request

 === Return
 @return [RightSupport::Net::RequestBalancer]