Permalink
Browse files

add simple Hello World DRb server and client

  • Loading branch information...
vinbarnes committed Jun 5, 2012
1 parent a1031f8 commit b4309e33c79c47a585c2a97d503c572582603747
Showing with 21 additions and 0 deletions.
  1. +5 −0 ch01/hello00.rb
  2. +16 −0 ch01/puts00.rb
View
@@ -0,0 +1,5 @@
+require 'drb/drb'
+
+uri = ARGV.shift
+there = DRbObject.new_with_uri(uri)
+there.puts('Hello World!')
View
@@ -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()

0 comments on commit b4309e3

Please sign in to comment.