summaryrefslogtreecommitdiff
path: root/sample/drb/speedc.rb
blob: 14d526d48da59ad87c549e9ca0d59661e79e93c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/local/bin/ruby

uri = ARGV.shift || raise("usage: #{$0} URI")
N = (ARGV.shift || 100).to_i

case uri
when /^tcpromp:/, /^unixromp:/
  require 'romp'

  client = ROMP::Client.new(uri, false)
  foo = client.resolve("foo")
when /^druby:/
  require 'drb/drb'
  
  DRb.start_service
  foo = DRbObject.new(nil, uri)
end

N.times do |n|
  foo.foo(n)
end