Module: Ferrum::Utils::Thread

Defined in:
lib/ferrum/utils/thread.rb

Class Method Summary collapse

Class Method Details

.spawn(abort_on_exception: true) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/ferrum/utils/thread.rb', line 8

def spawn(abort_on_exception: true)
  ::Thread.new(abort_on_exception) do |whether_abort_on_exception|
    ::Thread.current.abort_on_exception = whether_abort_on_exception
    ::Thread.current.report_on_exception = true if ::Thread.current.respond_to?(:report_on_exception=)

    yield
  end
end