module Ramaze::Helper::Thread

Public Instance Methods

thread(&block) click to toggle source

The thread method executes the specified block in a new thread.

@param [Block] block The block that contains the code that will be

executed in the new thread.
# File lib/ramaze/helper/thread.rb, line 13
def thread &block
  parent_thread = Thread.current
  Thread.new do
    begin
      block.call
    rescue Exception => e
      parent_thread.raise(e)
    end
  end
end