Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

add simple Hello World DRb server and client

  • Loading branch information...
commit b4309e33c79c47a585c2a97d503c572582603747 1 parent a1031f8
Kevin R. Barnes authored

Showing 2 changed files with 21 additions and 0 deletions. Show diff stats Hide diff stats

  1. +5 0 ch01/hello00.rb
  2. +16 0 ch01/puts00.rb
5 ch01/hello00.rb
... ... @@ -0,0 +1,5 @@
  1 +require 'drb/drb'
  2 +
  3 +uri = ARGV.shift
  4 +there = DRbObject.new_with_uri(uri)
  5 +there.puts('Hello World!')
16 ch01/puts00.rb
... ... @@ -0,0 +1,16 @@
  1 +require 'drb/drb'
  2 +
  3 +class Puts
  4 + def initialize(stream=$stdout)
  5 + @stream = stream
  6 + end
  7 +
  8 + def puts(str)
  9 + @stream.puts(str)
  10 + end
  11 +end
  12 +
  13 +uri = ARGV.shift
  14 +DRb.start_service(uri, Puts.new)
  15 +puts DRb.uri
  16 +DRb.thread.join()

0 comments on commit b4309e3

Please sign in to comment.
Something went wrong with that request. Please try again.