Module: Ramaze::Helper::Thread
- Defined in:
- lib/ramaze/helper/thread.rb
Instance Method Summary collapse
-
#thread(&block) ⇒ Object
The thread method executes the specified block in a new thread.
Instance Method Details
#thread(&block) ⇒ Object
The thread method executes the specified block in a new thread.
13 14 15 16 17 18 19 20 21 22 |
# 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 |