class Concurrent::Future

def wait_or_cancel(timeout)

Returns:
  • (Boolean) - true if the operation completed before the timeout

Parameters:
  • timeout (Numeric) -- the maximum time in seconds to wait.
def wait_or_cancel(timeout)
  wait(timeout)
  if complete?
    true
  else
    cancel
    false
  end
end