From a686414ef56dc289d28d96173c1fe5ab8ce0ac15 Mon Sep 17 00:00:00 2001 From: seki Date: Sat, 14 Feb 2004 02:28:02 +0000 Subject: import drb/sample git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- sample/drb/gw_ct.rb | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 sample/drb/gw_ct.rb (limited to 'sample/drb/gw_ct.rb') diff --git a/sample/drb/gw_ct.rb b/sample/drb/gw_ct.rb new file mode 100644 index 0000000000..0622784018 --- /dev/null +++ b/sample/drb/gw_ct.rb @@ -0,0 +1,29 @@ +require 'drb/drb' + +class Foo + include DRbUndumped + + def foo(n) + n + n + end + + def bar(n) + yield(n) + yield(n) + end +end + +DRb.start_service(nil) +puts DRb.uri + +ro = DRbObject.new(nil, ARGV.shift) +ro[:tcp] = Foo.new +gets + +it = ro[:unix] +p [it, it.foo(1)] +gets + +p it.bar('2') {|n| n * 3} +gets + + -- cgit v1.2.3