1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/rinda/ring.rb: Announce RingServer for the same process.

[ruby-trunk - Bug #9163]
	* test/rinda/test_rinda.rb:  Tests for the above.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
drbrain 2013-11-27 05:50:21 +00:00
parent fdcc476e21
commit 9c8f03fac9
3 changed files with 41 additions and 1 deletions

View file

@ -1,3 +1,9 @@
Wed Nov 27 14:50:02 2013 Eric Hodel <drbrain@segment7.net>
* lib/rinda/ring.rb: Announce RingServer for the same process.
[ruby-trunk - Bug #9163]
* test/rinda/test_rinda.rb: Tests for the above.
Wed Nov 27 14:37:33 2013 Aman Gupta <ruby@tmm1.net>
* test/ruby/test_eval.rb (class TestEval): Add test for shared eval

View file

@ -212,7 +212,7 @@ module Rinda
# address of the local TupleSpace.
def do_reply
tuple = @ts.take([:lookup_ring, DRbObject], @renewer)
tuple = @ts.take([:lookup_ring, nil], @renewer)
Thread.new { tuple[1].call(@ts) rescue nil}
rescue
end

View file

@ -558,6 +558,40 @@ class TestRingServer < Test::Unit::TestCase
@rs.shutdown
end
def test_do_reply
called = nil
callback = proc { |ts|
called = ts
}
callback = DRb::DRbObject.new callback
@ts.write [:lookup_ring, callback]
@rs.do_reply
Thread.pass until called
assert_same @ts, called
end
def test_do_reply_local
called = nil
callback = proc { |ts|
called = ts
}
@ts.write [:lookup_ring, callback]
@rs.do_reply
Thread.pass until called
assert_same @ts, called
end
def test_make_socket_unicast
v4 = @rs.make_socket('127.0.0.1')