Skip to content

Instantly share code, notes, and snippets.

@seki
Created June 30, 2009 17:13
Show Gist options
  • Save seki/138274 to your computer and use it in GitHub Desktop.
Save seki/138274 to your computer and use it in GitHub Desktop.
require 'drb/drb'
ro = DRbObject.new_with_uri(ARGV.shift)
name = 'your_nick'
url = 'http://your_page'
desc = 'your comment'
p ro.exchange(name, url, desc)
require 'rinda/tuplespace'
module Rinda
class Njet
def initialize(value)
@value = value
end
def ===(other)
@value != other
end
end
end
class CardHolder
def initialize
@ts = Rinda::TupleSpace.new
@ts.write(['m_seki', 'http://d.hatena.ne.jp/m_seki', 'Hello, Again'])
end
def exchange(name, url, desc)
@ts.write([name, url, desc])
@ts.take([Rinda::Njet.new(name), nil, nil])
end
end
DRb.start_service('druby://:56789', CardHolder.new)
puts DRb.uri
DRb.thread.join
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment