Created
September 14, 2023 16:35
-
-
Save squarism/136ecefa8c5c380deef165fd9de21ef1 to your computer and use it in GitHub Desktop.
Ruby DRB quicksummary
This file contains 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
require 'drb/drb' | |
DRb.start_service | |
remote = DRbObject.new_with_uri("druby://localhost:8787") | |
remote.pid | |
# => <some pid> | |
# you can verify the PIDs with top and you can filter by process name like ruby or irb or something |
This file contains 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
require 'drb/drb' | |
class Server | |
def pid | |
Process.pid | |
end | |
end | |
DRb.start_service("druby://localhost:8787", Server.new) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment