Oh, duh - Thread.value
evaluates to the output of the last expression in the thread, and join
takes a time limit. So it's as simple as:
thread = `Thread.new{ `command options` }.join(180)
results = thread.value unless thread.nil?
Need to do the nil
check since if you kill the thread you get nil
out.