Created
January 23, 2018 16:27
-
-
Save olleolleolle/4d9760a93c133f94c75d94cc176e498a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# client.rb | |
require 'drb/drb' | |
DRb.start_service | |
remote_object = DRbObject.new_with_uri('druby://localhost:9999') | |
p remote_object.greet #=> 'Hello, world!' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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