lib/polyphony/extensions/thread.rb in polyphony-0.36 vs lib/polyphony/extensions/thread.rb in polyphony-0.38
- old
+ new
@@ -1,8 +1,8 @@
# frozen_string_literal: true
-Exceptions = import '../core/exceptions'
+require_relative '../core/exceptions'
# Thread extensions
class ::Thread
attr_reader :main_fiber, :result
@@ -17,11 +17,11 @@
def execute
setup
@ready = true
result = @block.(*@args)
- rescue Exceptions::MoveOn, Exceptions::Terminate => e
+ rescue Polyphony::MoveOn, Polyphony::Terminate => e
result = e.value
rescue Exception => e
result = e
ensure
@ready = true
@@ -76,10 +76,10 @@
main_fiber&.raise(error)
end
alias_method :orig_kill, :kill
def kill
- raise Exceptions::Terminate
+ raise Polyphony::Terminate
end
alias_method :orig_inspect, :inspect
def inspect
return orig_inspect if self == Thread.main