OSDN Git Service
(root)
/
splhack
/
AndroidRuby.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
ruby-1.9.1-rc1
[splhack/AndroidRuby.git]
/
lib
/
ruby-1.9.1-rc1
/
sample
/
drb
/
rindas.rb
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