Method: Thread#join

Defined in:
lib/polyphony/extensions/thread.rb

#join(timeout = nil) ⇒ any Also known as: await

Waits for the thread to terminate and returns its return value. If the thread terminated with an uncaught exception, it is propagated to the waiting fiber. If a timeout interval is specified, the thread will be terminated without propagating the timeout exception.

Parameters:

  • timeout (Number) (defaults to: nil)

    timeout interval

Returns:

  • (any)

    thread's return value



42
43
44
# File 'lib/polyphony/extensions/thread.rb', line 42

def join(timeout = nil)
  timeout ? move_on_after(timeout) { await_done } : await_done
end