Created
July 28, 2020 12:59
-
-
Save jonatas/2aed03f8b30b5bbaf6412375da78e359 to your computer and use it in GitHub Desktop.
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' | |
SERVER_URI="druby://localhost:8787" | |
# Start a local DRbServer to handle callbacks. | |
# | |
# Not necessary for this small example, but will be required | |
# as soon as we pass a non-marshallable object as an argument | |
# to a dRuby call. | |
# | |
# Note: this must be called at least once per process to take any effect. | |
# This is particularly important if your application forks. | |
DRb.start_service | |
def run cmd | |
DRbObject.new_with_uri(SERVER_URI).command(cmd) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment