Added configuration based routing (direct, random and round-robin) to the remote actors created by the RemoteActorRefProvider, also changed the configuration to allow specifying multiple remote nodes for a remotely configured actor.
Signed-off-by: Jonas Bonér <jonas@jonasboner.com>
This commit is contained in:
parent
0957e41d19
commit
d124f6e781
8 changed files with 82 additions and 119 deletions
|
|
@ -14,103 +14,6 @@ import java.util.concurrent.{ CountDownLatch, TimeUnit }
|
|||
|
||||
class ConfiguredLocalRoutingSpec extends WordSpec with MustMatchers {
|
||||
|
||||
// "direct router" must {
|
||||
|
||||
// "be able to shut down its instance" in {
|
||||
// val address = "direct-0"
|
||||
|
||||
// Deployer.deploy(
|
||||
// Deploy(
|
||||
// address,
|
||||
// None,
|
||||
// Direct,
|
||||
// NrOfInstances(1),
|
||||
// RemoveConnectionOnFirstFailureLocalFailureDetector,
|
||||
// LocalScope))
|
||||
|
||||
// val helloLatch = new CountDownLatch(1)
|
||||
// val stopLatch = new CountDownLatch(1)
|
||||
|
||||
// val actor = actorOf(new Actor {
|
||||
// def receive = {
|
||||
// case "hello" ⇒ helloLatch.countDown()
|
||||
// }
|
||||
|
||||
// override def postStop() {
|
||||
// stopLatch.countDown()
|
||||
// }
|
||||
// }, address)
|
||||
|
||||
// actor ! "hello"
|
||||
|
||||
// helloLatch.await(5, TimeUnit.SECONDS) must be(true)
|
||||
|
||||
// actor.stop()
|
||||
|
||||
// stopLatch.await(5, TimeUnit.SECONDS) must be(true)
|
||||
// }
|
||||
|
||||
// "send message to connection" in {
|
||||
// val address = "direct-1"
|
||||
|
||||
// Deployer.deploy(
|
||||
// Deploy(
|
||||
// address,
|
||||
// None,
|
||||
// Direct,
|
||||
// NrOfInstances(1),
|
||||
// RemoveConnectionOnFirstFailureLocalFailureDetector,
|
||||
// LocalScope))
|
||||
|
||||
// val doneLatch = new CountDownLatch(1)
|
||||
|
||||
// val counter = new AtomicInteger(0)
|
||||
// val actor = actorOf(new Actor {
|
||||
// def receive = {
|
||||
// case "end" ⇒ doneLatch.countDown()
|
||||
// case _ ⇒ counter.incrementAndGet()
|
||||
// }
|
||||
// }, address)
|
||||
|
||||
// actor ! "hello"
|
||||
// actor ! "end"
|
||||
|
||||
// doneLatch.await(5, TimeUnit.SECONDS) must be(true)
|
||||
|
||||
// counter.get must be(1)
|
||||
// }
|
||||
|
||||
// "deliver a broadcast message" in {
|
||||
// val address = "direct-2"
|
||||
|
||||
// Deployer.deploy(
|
||||
// Deploy(
|
||||
// address,
|
||||
// None,
|
||||
// Direct,
|
||||
// NrOfInstances(1),
|
||||
// RemoveConnectionOnFirstFailureLocalFailureDetector,
|
||||
// LocalScope))
|
||||
|
||||
// val doneLatch = new CountDownLatch(1)
|
||||
|
||||
// val counter1 = new AtomicInteger
|
||||
// val actor = actorOf(new Actor {
|
||||
// def receive = {
|
||||
// case "end" ⇒ doneLatch.countDown()
|
||||
// case msg: Int ⇒ counter1.addAndGet(msg)
|
||||
// }
|
||||
// }, address)
|
||||
|
||||
// actor ! Broadcast(1)
|
||||
// actor ! "end"
|
||||
|
||||
// doneLatch.await(5, TimeUnit.SECONDS) must be(true)
|
||||
|
||||
// counter1.get must be(1)
|
||||
// }
|
||||
// }
|
||||
|
||||
"round robin router" must {
|
||||
|
||||
"be able to shut down its instance" in {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue