* io.c (rb_open_file): encoding in mode string was ignored if perm is
[ruby-svn.git] / sample / drb / rindas.rb
blob9fd9ada2d101068cbf07daa1c38e4466177cfa90
1 require 'drb/drb'
2 require 'rinda/rinda'
4 def do_it(v)
5   puts "do_it(#{v})"
6   v + v
7 end
9 uri = ARGV.shift || raise("usage: #{$0} <server_uri>")
11 DRb.start_service
12 ts = Rinda::TupleSpaceProxy.new(DRbObject.new(nil, uri))
14 while true
15   r = ts.take(['sum', nil, nil])
16   v = do_it(r[2])
17   ts.write(['ans', r[1], r[2], v])
18 end