def init(type, auth_client, options)
      raise ArgumentError, "Auth client does not support server type #{type.inspect}" unless auth_client.respond_to?(type.to_s + "_url")
      raise ArgumentError, ":api_version option missing" unless options[:api_version]
      @type = type
      @auth_client = auth_client
      @http_client = nil
      @status_callbacks = []
      @options = options.dup
      @options[:server_name] ||= type.to_s
      @options[:open_timeout] ||= DEFAULT_OPEN_TIMEOUT
      @options[:request_timeout] ||= DEFAULT_REQUEST_TIMEOUT
      @options[:retry_timeout] ||= DEFAULT_RETRY_TIMEOUT
      @options[:retry_intervals] ||= DEFAULT_RETRY_INTERVALS
      @options[:reconnect_interval] ||= DEFAULT_RECONNECT_INTERVAL
      reset_stats
      @state = :pending
      create_http_client
      enable_use if check_health == :connected
      state == :connected
    end
def init(type, auth_client, options)
      raise ArgumentError, "Auth client does not support server type #{type.inspect}" unless auth_client.respond_to?(type.to_s + "_url")
      raise ArgumentError, ":api_version option missing" unless options[:api_version]
      @type = type
      @auth_client = auth_client
      @http_client = nil
      @status_callbacks = []
      @options = options.dup
      @options[:server_name] ||= type.to_s
      @options[:open_timeout] ||= DEFAULT_OPEN_TIMEOUT
      @options[:request_timeout] ||= DEFAULT_REQUEST_TIMEOUT
      @options[:retry_timeout] ||= DEFAULT_RETRY_TIMEOUT
      @options[:retry_intervals] ||= DEFAULT_RETRY_INTERVALS
      @options[:reconnect_interval] ||= DEFAULT_RECONNECT_INTERVAL
      reset_stats
      @state = :pending
      create_http_client
      enable_use if check_health == :connected
      state == :connected
    end
Set configuration of this client and initialize HTTP access

 @param [Symbol] type of server for use in obtaining URL from auth_client, e.g., :router
 @param [AuthClient] auth_client providing authorization session for HTTP requests

 @option options [String] :server_name for use in reporting errors, e.g., RightNet
 @option options [String] :api_version of server for use in X-API-Version header
 @option options [Numeric] :open_timeout maximum wait for connection; defaults to DEFAULT_OPEN_TIMEOUT
 @option options [Numeric] :request_timeout maximum wait for response; defaults to DEFAULT_REQUEST_TIMEOUT
 @option options [Numeric] :retry_timeout maximum before stop retrying; defaults to DEFAULT_RETRY_TIMEOUT
 @option options [Array] :retry_intervals between successive retries; defaults to DEFAULT_RETRY_INTERVALS
 @option options [Boolean] :retry_enabled for requests that fail to connect or that return a retry result
 @option options [Numeric] :reconnect_interval for reconnect attempts after lose connectivity
 @option options [Boolean] :non_blocking i/o is to be used for HTTP requests by applying
   EM::HttpRequest and fibers instead of RestClient; requests remain synchronous
 @option options [Array] :filter_params symbols or strings for names of request parameters
   whose values are to be hidden when logging; also applied to contents of any parameters
   named :payload; can be augmented on individual requests

 @return [Boolean] whether currently connected

 @raise [ArgumentError] auth client does not support this client type
 @raise [ArgumentError] :api_version missing