зеркало из https://github.com/github/ruby.git
* lib/rinda/ring.rb: split executable code into sample directory.
* sample/rinda-ring.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
bff692b94d
Коммит
59ca946543
|
@ -1,3 +1,8 @@
|
|||
Thu Aug 21 13:23:34 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
|
||||
|
||||
* lib/rinda/ring.rb: split executable code into sample directory.
|
||||
* sample/rinda-ring.rb: ditto.
|
||||
|
||||
Thu Aug 21 13:21:45 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
|
||||
|
||||
* lib/drb/acl.rb: split executable code into sample directory.
|
||||
|
|
|
@ -478,27 +478,3 @@ module Rinda
|
|||
end
|
||||
|
||||
end
|
||||
|
||||
if __FILE__ == $0
|
||||
DRb.start_service
|
||||
case ARGV.shift
|
||||
when 's'
|
||||
require 'rinda/tuplespace'
|
||||
ts = Rinda::TupleSpace.new
|
||||
Rinda::RingServer.new(ts)
|
||||
$stdin.gets
|
||||
when 'w'
|
||||
finger = Rinda::RingFinger.new(nil)
|
||||
finger.lookup_ring do |ts2|
|
||||
p ts2
|
||||
ts2.write([:hello, :world])
|
||||
end
|
||||
when 'r'
|
||||
finger = Rinda::RingFinger.new(nil)
|
||||
finger.lookup_ring do |ts2|
|
||||
p ts2
|
||||
p ts2.take([nil, nil])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
require 'rinda/ring'
|
||||
|
||||
DRb.start_service
|
||||
case ARGV.shift
|
||||
when 's'
|
||||
require 'rinda/tuplespace'
|
||||
ts = Rinda::TupleSpace.new
|
||||
Rinda::RingServer.new(ts)
|
||||
$stdin.gets
|
||||
when 'w'
|
||||
finger = Rinda::RingFinger.new(nil)
|
||||
finger.lookup_ring do |ts2|
|
||||
p ts2
|
||||
ts2.write([:hello, :world])
|
||||
end
|
||||
when 'r'
|
||||
finger = Rinda::RingFinger.new(nil)
|
||||
finger.lookup_ring do |ts2|
|
||||
p ts2
|
||||
p ts2.take([nil, nil])
|
||||
end
|
||||
end
|
Загрузка…
Ссылка в новой задаче