class Excon::Socket
def request_time_remaining
Returns the remaining time in seconds until we reach the deadline for the request timeout.
def request_time_remaining now = Process.clock_gettime(Process::CLOCK_MONOTONIC) deadline = @data[:deadline] raise(Excon::Errors::Timeout.new('request timeout reached')) if now >= deadline deadline - now end