Module: Ramaze::Helper::Thread

Defined in:
lib/ramaze/helper/thread.rb

Instance Method Summary collapse

Instance Method Details

#thread(&block) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/ramaze/helper/thread.rb', line 6

def thread &block
  parent_thread = Thread.current
  Thread.new do
    begin
      block.call
    rescue Exception => e
      parent_thread.raise(e)
    end
  end
end