diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-25 15:13:14 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-25 15:13:14 +0000 |
commit | d0233291bc8a5068e52c69c210e5979e5324b5bc (patch) | |
tree | 7d9459449c33792c63eeb7baa071e76352e0baab /trunk/sample/drb/extserv_test.rb | |
parent | 0dc342de848a642ecce8db697b8fecd83a63e117 (diff) | |
parent | 72eaacaa15256ab95c3b52ea386f88586fb9da40 (diff) |
re-adding tag v1_9_0_4 as an alias of trunk@18848v1_9_0_4
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_9_0_4@18849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'trunk/sample/drb/extserv_test.rb')
-rw-r--r-- | trunk/sample/drb/extserv_test.rb | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/trunk/sample/drb/extserv_test.rb b/trunk/sample/drb/extserv_test.rb deleted file mode 100644 index 83d871a6a2..0000000000 --- a/trunk/sample/drb/extserv_test.rb +++ /dev/null @@ -1,80 +0,0 @@ -=begin - dRuby sample - Copyright (c) 2000 Masatoshi SEKI - -= How to play - -* Terminal 1 - - % ruby -I. extserv_test.rb server - druby://yourhost:12345 - -* Terminal 2 - - % ruby -I. extserv_test.rb druby://yourhost:12345 - ... - -=end - -require 'drb/drb' - -def ARGV.shift - it = super() - raise "usage:\nserver: #{$0} server [<uri>]\nclient: #{$0} [quit] <uri>" unless it - it -end - -class Foo - include DRbUndumped - - def initialize(str) - @str = str - end - - def hello(it) - "#{it}: #{self}" - end - - def to_s - @str - end -end - -cmd = ARGV.shift -case cmd -when 'itest1', 'itest2' - require 'drb/extserv' - - front = Foo.new(cmd) - server = DRb::DRbServer.new(nil, front) - es = DRb::ExtServ.new(ARGV.shift, ARGV.shift, server) - server.thread.join - -when 'server' - require 'drb/extservm' - - DRb::ExtServManager.command['itest1'] = "ruby -I. #{$0} itest1" - DRb::ExtServManager.command['itest2'] = "ruby -I. #{$0} itest2" - - s = DRb::ExtServManager.new - DRb.start_service(ARGV.shift, s) - puts DRb.uri - DRb.thread.join - - -else - uri = (cmd == 'quit') ? ARGV.shift : cmd - - DRb.start_service - s = DRbObject.new(nil, uri) - t1 = s.service('itest1').front - puts t1 - t2 = s.service('itest2').front - puts t2 - puts t1.hello(t2) - if (cmd == 'quit') - s.service('itest1').stop_service - s.service('itest2').stop_service - end -end - |