class HTTPX::Resolver::System

  1. lib/httpx/resolver/system.rb
Superclass: Object

Methods

Public Class

  1. new

Public Instance

  1. <<
  2. closed?
  3. empty?
  4. uncache

Included modules

  1. Resolver::ResolverMixin

Constants

RESOLV_ERRORS = [Resolv::ResolvError, Resolv::DNS::Requester::RequestError, Resolv::DNS::EncodeError, Resolv::DNS::DecodeError].freeze  

Public Class methods

new (options)
[show source]
   # File lib/httpx/resolver/system.rb
15 def initialize(options)
16   @options = Options.new(options)
17   roptions = @options.resolver_options
18   @state = :idle
19   @resolver = Resolv::DNS.new(roptions.nil? ? nil : roptions)
20   @resolver.timeouts = roptions[:timeouts] if roptions
21 end

Public Instance methods

<< (connection)
[show source]
   # File lib/httpx/resolver/system.rb
31 def <<(connection)
32   hostname = connection.origin.host
33   addresses = connection.addresses ||
34               ip_resolve(hostname) ||
35               system_resolve(hostname) ||
36               @resolver.getaddresses(hostname)
37   return emit_resolve_error(connection, hostname) if addresses.empty?
38 
39   emit_addresses(connection, addresses)
40 rescue Errno::EHOSTUNREACH, *RESOLV_ERRORS => e
41   emit_resolve_error(connection, hostname, e)
42 end
closed? ()
[show source]
   # File lib/httpx/resolver/system.rb
23 def closed?
24   true
25 end
empty? ()
[show source]
   # File lib/httpx/resolver/system.rb
27 def empty?
28   true
29 end
uncache (*)
[show source]
   # File lib/httpx/resolver/system.rb
44 def uncache(*); end