Merge branch 'master' of github.com:akka/akka

This commit is contained in:
Viktor Klang 2012-04-27 17:32:56 +02:00
commit 6494447ed6
2 changed files with 28 additions and 7 deletions

View file

@ -7,8 +7,7 @@ import java.util.concurrent.atomic.AtomicInteger
import org.junit.runner.RunWith
import akka.actor.actorRef2Scala
import akka.actor.{ Props, LocalActorRef, Deploy, Actor }
import akka.actor.{ Props, LocalActorRef, Deploy, Actor, ActorRef }
import akka.config.ConfigurationException
import akka.dispatch.Await
import akka.pattern.{ ask, gracefulStop }
@ -31,6 +30,14 @@ object ConfiguredLocalRoutingSpec {
router = random
nr-of-instances = 4
}
/weird {
router = round-robin
nr-of-instances = 3
}
"/weird/*" {
router = round-robin
nr-of-instances = 2
}
}
}
}
@ -88,6 +95,17 @@ class ConfiguredLocalRoutingSpec extends AkkaSpec(ConfiguredLocalRoutingSpec.con
}
}
"not get confused when trying to wildcard-configure children" in {
val router = system.actorOf(Props(new Actor {
testActor ! self
def receive = { case _ }
}).withRouter(FromConfig), "weird")
val recv = Set() ++ (for (_ 1 to 3) yield expectMsgType[ActorRef])
val expc = Set('a', 'b', 'c') map (i system.actorFor("/user/weird/$" + i))
recv must be(expc)
expectNoMsg(1 second)
}
}
"round robin router" must {

View file

@ -118,12 +118,12 @@ class ZeromqDocSpec extends AkkaSpec("akka.loglevel=INFO") {
//#pub-socket
import akka.zeromq.ZeroMQExtension
val pubSocket = ZeroMQExtension(system).newSocket(SocketType.Pub, Bind("tcp://127.0.0.1:1234"))
val pubSocket = ZeroMQExtension(system).newSocket(SocketType.Pub, Bind("tcp://127.0.0.1:21231"))
//#pub-socket
//#pub-socket2
import akka.zeromq._
val pubSocket2 = system.newSocket(SocketType.Pub, Bind("tcp://127.0.0.1:1234"))
val pubSocket2 = system.newSocket(SocketType.Pub, Bind("tcp://127.0.0.1:21232"))
//#pub-socket2
//#sub-socket
@ -135,11 +135,11 @@ class ZeromqDocSpec extends AkkaSpec("akka.loglevel=INFO") {
case _ //...
}
}))
val subSocket = system.newSocket(SocketType.Sub, Listener(listener), Connect("tcp://127.0.0.1:1234"), SubscribeAll)
val subSocket = system.newSocket(SocketType.Sub, Listener(listener), Connect("tcp://127.0.0.1:21231"), SubscribeAll)
//#sub-socket
//#sub-topic-socket
val subTopicSocket = system.newSocket(SocketType.Sub, Listener(listener), Connect("tcp://127.0.0.1:1234"), Subscribe("foo.bar"))
val subTopicSocket = system.newSocket(SocketType.Sub, Listener(listener), Connect("tcp://127.0.0.1:21231"), Subscribe("foo.bar"))
//#sub-topic-socket
//#unsub-topic-socket
@ -151,11 +151,14 @@ class ZeromqDocSpec extends AkkaSpec("akka.loglevel=INFO") {
pubSocket ! ZMQMessage(Seq(Frame("foo.bar"), Frame(payload)))
//#pub-topic
system.stop(subSocket)
system.stop(subTopicSocket)
//#high-watermark
val highWatermarkSocket = system.newSocket(
SocketType.Router,
Listener(listener),
Bind("tcp://127.0.0.1:1234"),
Bind("tcp://127.0.0.1:21233"),
HighWatermark(50000))
//#high-watermark
}