Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add simple Hello World DRb server and client

  • Loading branch information...
commit b4309e33c79c47a585c2a97d503c572582603747 1 parent a1031f8
@vinbarnes authored
Showing with 21 additions and 0 deletions.
  1. +5 −0 ch01/hello00.rb
  2. +16 −0 ch01/puts00.rb
View
5 ch01/hello00.rb
@@ -0,0 +1,5 @@
+require 'drb/drb'
+
+uri = ARGV.shift
+there = DRbObject.new_with_uri(uri)
+there.puts('Hello World!')
View
16 ch01/puts00.rb
@@ -0,0 +1,16 @@
+require 'drb/drb'
+
+class Puts
+ def initialize(stream=$stdout)
+ @stream = stream
+ end
+
+ def puts(str)
+ @stream.puts(str)
+ end
+end
+
+uri = ARGV.shift
+DRb.start_service(uri, Puts.new)
+puts DRb.uri
+DRb.thread.join()
Please sign in to comment.
Something went wrong with that request. Please try again.