Server:
#!/usr/bin/env ruby
# File: example/net/drb/server.rb
require 'drb'
class TestServer
def doit
"Hello, Distributed World"
end
end
aServerObject = TestServer.new
DRb.start_service('druby://localhost:9000', aServerObject)
DRb.thread.join # Don't exit just yet!
Klient:
#!/usr/bin/env ruby # File: example/net/drb/client.rb require 'drb' DRb.start_service() obj = DRbObject.new(nil, 'druby://localhost:9000') # Now use obj p obj.doit
