Class: Selenium::WebDriver::Remote::Http::Default Private

Inherits:
Common
  • Object
show all
Defined in:
lib/selenium/webdriver/remote/http/default.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Constant Summary

Constants inherited from Common

Common::BINARY_ENCODINGS, Common::CONTENT_TYPE, Common::DEFAULT_HEADERS, Common::MAX_REDIRECTS

Instance Attribute Summary

Attributes inherited from Common

#client_config

Instance Method Summary collapse

Methods inherited from Common

#call, extra_headers, extra_headers=, #quit_errors, #server_url=, user_agent, user_agent=

Constructor Details

#initialize(client_config: nil, open_timeout: nil, read_timeout: nil) ⇒ Default

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Initializes object. Warning: Setting #open_timeout to non-nil values will cause a separate thread to spawn. Debuggers that freeze the process will not be able to evaluate any operations if that happens.

Parameters:

  • client_config (ClientConfig) (defaults to: nil)
    • Configuration used to build the HTTP client.
  • open_timeout (Numeric) (defaults to: nil)
    • Open timeout to apply to HTTP client.
  • read_timeout (Numeric) (defaults to: nil)
    • Read timeout (seconds) to apply to HTTP client.


33
34
35
36
37
38
39
40
41
42
# File 'lib/selenium/webdriver/remote/http/default.rb', line 33

def initialize(client_config: nil, open_timeout: nil, read_timeout: nil)
  if client_config && (open_timeout || read_timeout)
    raise ArgumentError, 'Cannot use both :client_config and :open_timeout/:read_timeout'
  end

  client_config ||= ClientConfig.new
  client_config.open_timeout = open_timeout if open_timeout
  client_config.read_timeout = read_timeout if read_timeout
  super(client_config: client_config)
end

Instance Method Details

#closeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



64
65
66
# File 'lib/selenium/webdriver/remote/http/default.rb', line 64

def close
  @http&.finish
end

#open_timeoutObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



44
45
46
# File 'lib/selenium/webdriver/remote/http/default.rb', line 44

def open_timeout
  client_config.open_timeout
end

#open_timeout=(value) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



52
53
54
# File 'lib/selenium/webdriver/remote/http/default.rb', line 52

def open_timeout=(value)
  client_config.open_timeout = value
end

#proxy=(value) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



60
61
62
# File 'lib/selenium/webdriver/remote/http/default.rb', line 60

def proxy=(value)
  client_config.proxy = value
end

#read_timeoutObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



48
49
50
# File 'lib/selenium/webdriver/remote/http/default.rb', line 48

def read_timeout
  client_config.read_timeout
end

#read_timeout=(value) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



56
57
58
# File 'lib/selenium/webdriver/remote/http/default.rb', line 56

def read_timeout=(value)
  client_config.read_timeout = value
end