Skip to content

Instantly share code, notes, and snippets.

@jonatas
Created July 28, 2020 12:59
Show Gist options
  • Save jonatas/2aed03f8b30b5bbaf6412375da78e359 to your computer and use it in GitHub Desktop.
Save jonatas/2aed03f8b30b5bbaf6412375da78e359 to your computer and use it in GitHub Desktop.
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