Skip to content

Instantly share code, notes, and snippets.

@seki
Created November 26, 2009 21:46
Show Gist options
  • Save seki/243675 to your computer and use it in GitHub Desktop.
Save seki/243675 to your computer and use it in GitHub Desktop.
#terminal 1
duo:~ mas$ irb
irb(main):001:0> require 'drb/drb'
=> true
irb(main):002:0> DRb.start_service
ro => #<DRb::DRbServer:0...
irb(main):003:0> ro = DRbObject.new_with_uri('druby://localhost:54300')
=> #<DRb::DRbObject...
irb(main):004:0> ro[1] = 'Hello, World.'
=> "Hello, World."
irb(main):005:0> ro[1]
=> "Hello, World."
irb(main):006:0> ro[1] = nil
=> nil
irb(main):007:0> ro[1]
=> nil
# terminai 2
duo:~ mas$ irb
irb(main):001:0> require 'drb/drb'
=> true
irb(main):002:0> DRb.start_service
ro => #<DRb::DRbServer:0...
irb(main):003:0> ro = DRbObject.new_with_uri('druby://localhost:54300')
=> #<DRb::DRbObject...
irb(main):004:0> ro[1]
=> "Hello, World."
irb(main):006:0> ro[2] = 'Hello, Again.'
=> "Hello, Again."
require 'drb/drb'
DRb.start_service('druby://localhost:54300', Hash.new)
while true
sleep 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment