repo.or.cz
/
ruby-svn.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
* io.c (rb_open_file): encoding in mode string was ignored if perm is
[ruby-svn.git]
/
sample
/
drb
/
rindas.rb
blob
9fd9ada2d101068cbf07daa1c38e4466177cfa90
1
require 'drb/drb'
2
require 'rinda/rinda'
3
4
def do_it(v)
5
puts "do_it(#{v})"
6
v + v
7
end
8
9
uri = ARGV.shift || raise("usage: #{$0} <server_uri>")
10
11
DRb.start_service
12
ts = Rinda::TupleSpaceProxy.new(DRbObject.new(nil, uri))
13
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