summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorseki <seki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-06-28 22:03:41 +0000
committerseki <seki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-06-28 22:03:41 +0000
commitd5f31755fc38100a76e0d89f07951995504a4bf7 (patch)
treed973359be9b5c080546012283c9d072ea29ce2ce /lib
parent3d4c49ee3bc232431ce67c6008b785f7e80544d4 (diff)
import drb-2.0.4 (use LocalJumpeError#reason)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/drb/drb.rb49
-rw-r--r--lib/drb/invokemethod.rb10
2 files changed, 3 insertions, 56 deletions
diff --git a/lib/drb/drb.rb b/lib/drb/drb.rb
index 85cd3bc898..e6ea35cfc1 100644
--- a/lib/drb/drb.rb
+++ b/lib/drb/drb.rb
@@ -689,17 +689,6 @@ module DRb
end
end
- def rescue_local_jump(err)
- case err.message
- when /^retry/ # retry from proc-closure
- return :retry
- when /^break/ # break from proc-closure
- return rescue_break(err)
- else
- return :unknown
- end
- end
-
end
if RUBY_VERSION >= '1.8'
@@ -708,43 +697,7 @@ module DRb
include InvokeMethod18Mixin
end
else
- module InvokeMethod16Mixin
- def block_yield(x)
- if x.class == Array
- block_value = @block.__drb_yield(*x)
- else
- block_value = @block.__drb_yield(x)
- end
- end
-
- def rescue_break(err)
- return :break
- end
-
- def perform_with_block
- @obj.__send__(@msg_id, *@argv) do |x|
- jump_error = nil
- begin
- block_value = block_yield(x)
- rescue LocalJumpError
- jump_error = $!
- end
- if jump_error
- reason ,= rescue_local_jump(jump_error)
- case reason
- when :retry
- retry
- when :break
- break
- else
- raise jump_error
- end
- end
- block_value
- end
- end
- end
-
+ require 'drb/invokemethod16'
class InvokeMethod
include InvokeMethod16Mixin
end
diff --git a/lib/drb/invokemethod.rb b/lib/drb/invokemethod.rb
index f8ce0ad09b..6d6c9562c3 100644
--- a/lib/drb/invokemethod.rb
+++ b/lib/drb/invokemethod.rb
@@ -1,4 +1,3 @@
-
# for ruby-1.8.0
module DRb
@@ -8,10 +7,6 @@ module DRb
block_value = @block.call(*x)
end
- def rescue_break(err)
- return :break, err.exit_value
- end
-
def perform_with_block
@obj.__send__(@msg_id, *@argv) do |*x|
jump_error = nil
@@ -21,12 +16,11 @@ module DRb
jump_error = $!
end
if jump_error
- reason, jump_value = rescue_local_jump(jump_error)
- case reason
+ case jump_error.reason
when :retry
retry
when :break
- break(jump_value)
+ break(jump_error.exit_value)
else
raise jump_error
end