Skip to content

Instantly share code, notes, and snippets.

@olleolleolle
Created January 23, 2018 16:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olleolleolle/4d9760a93c133f94c75d94cc176e498a to your computer and use it in GitHub Desktop.
Save olleolleolle/4d9760a93c133f94c75d94cc176e498a to your computer and use it in GitHub Desktop.
# client.rb
require 'drb/drb'
DRb.start_service
remote_object = DRbObject.new_with_uri('druby://localhost:9999')
p remote_object.greet #=> 'Hello, world!'
# server.rb
require 'drb/drb'
class MyApp
def greet
'Hello, world!'
end
end
object = MyApp.new
DRb.start_service('druby://localhost:9999', object)
DRb.thread.join
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment