Class: Rev::DNSResolver::Timeout
- Inherits:
-
TimerWatcher
- Object
- Watcher
- TimerWatcher
- Rev::DNSResolver::Timeout
- Defined in:
- lib/rev/dns_resolver.rb
Instance Method Summary collapse
-
#initialize(resolver) ⇒ Timeout
constructor
A new instance of Timeout.
- #on_timer ⇒ Object
Methods inherited from TimerWatcher
#attach, #detach, #disable, #enable, #reset
Methods included from Meta
#event_callback, #watcher_delegate
Methods inherited from Watcher
#attach, #attached?, #detach, #disable, #enable, #enabled?, #evloop
Constructor Details
Instance Method Details
#on_timer ⇒ Object
200 201 202 203 204 205 206 207 208 209 210 211 |
# File 'lib/rev/dns_resolver.rb', line 200 def on_timer @attempts += 1 if @attempts <= RETRIES begin return @resolver.__send__(:send_request) rescue Errno::EHOSTUNREACH # if the DNS is toast try again after the timeout occurs again return nil end end @resolver.__send__(:on_timeout) @resolver.detach end |