So I am using Resolver in Rails 3.1 to try to get the DHCP address of a server and I want to allow a certain time for it to query…perhaps .5 sec because it is slowing down my entire request.
This is what I have right now..
$begin
$Resolver('ipaddress').answer[0]
$rescue
$end
This currently takes a while so is there a way to say, “I want to run this snippet for 0.5 sec” and then move on?
Thanks!
http://ruby-doc.org/stdlib-1.9.3/libdoc/timeout/rdoc/Timeout.html