diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-11-27 05:50:21 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-11-27 05:50:21 +0000 |
commit | 9c8f03fac927d153f314be4259c5b7fc9b7fedc9 (patch) | |
tree | 7ca75b801b7b5a52b1221fec0fdbedcbde1c6e96 | |
parent | fdcc476e217eac6143e7d1585900955c7ceda737 (diff) | |
download | ruby-9c8f03fac927d153f314be4259c5b7fc9b7fedc9.tar.gz |
* 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
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | lib/rinda/ring.rb | 2 | ||||
-rw-r--r-- | test/rinda/test_rinda.rb | 34 |
3 files changed, 41 insertions, 1 deletions
@@ -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 diff --git a/lib/rinda/ring.rb b/lib/rinda/ring.rb index 29ea5f0ff6..1ecc56a4f5 100644 --- a/lib/rinda/ring.rb +++ b/lib/rinda/ring.rb @@ -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 diff --git a/test/rinda/test_rinda.rb b/test/rinda/test_rinda.rb index 2bda9cc363..448c4fe02f 100644 --- a/test/rinda/test_rinda.rb +++ b/test/rinda/test_rinda.rb @@ -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') |