=doc #3689 Don't rewrite arrows in doc and samples
This commit is contained in:
parent
37f8f2831b
commit
5a019c0a7a
61 changed files with 531 additions and 517 deletions
|
|
@ -18,9 +18,9 @@ object ConsistentHashingRouterDocSpec {
|
|||
var cache = Map.empty[String, String]
|
||||
|
||||
def receive = {
|
||||
case Entry(key, value) ⇒ cache += (key -> value)
|
||||
case Get(key) ⇒ sender ! cache.get(key)
|
||||
case Evict(key) ⇒ cache -= key
|
||||
case Entry(key, value) => cache += (key -> value)
|
||||
case Get(key) => sender ! cache.get(key)
|
||||
case Evict(key) => cache -= key
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -50,7 +50,7 @@ class ConsistentHashingRouterDocSpec extends AkkaSpec with ImplicitSender {
|
|||
import akka.routing.ConsistentHashingRouter.ConsistentHashableEnvelope
|
||||
|
||||
def hashMapping: ConsistentHashMapping = {
|
||||
case Evict(key) ⇒ key
|
||||
case Evict(key) => key
|
||||
}
|
||||
|
||||
val cache: ActorRef =
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ akka.actor.deployment {
|
|||
class RedundancyRoutingLogic(nbrCopies: Int) extends RoutingLogic {
|
||||
val roundRobin = RoundRobinRoutingLogic()
|
||||
def select(message: Any, routees: immutable.IndexedSeq[Routee]): Routee = {
|
||||
val targets = (1 to nbrCopies).map(_ ⇒ roundRobin.select(message, routees))
|
||||
val targets = (1 to nbrCopies).map(_ => roundRobin.select(message, routees))
|
||||
SeveralRoutees(targets)
|
||||
}
|
||||
}
|
||||
|
|
@ -58,7 +58,7 @@ akka.actor.deployment {
|
|||
|
||||
class Storage extends Actor {
|
||||
def receive = {
|
||||
case x ⇒ sender ! x
|
||||
case x => sender ! x
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -99,7 +99,7 @@ class CustomRouterDocSpec extends AkkaSpec(CustomRouterDocSpec.config) with Impl
|
|||
//#unit-test-logic
|
||||
val logic = new RedundancyRoutingLogic(nbrCopies = 3)
|
||||
|
||||
val routees = for (n ← 1 to 7) yield TestRoutee(n)
|
||||
val routees = for (n <- 1 to 7) yield TestRoutee(n)
|
||||
|
||||
val r1 = logic.select("msg", routees)
|
||||
r1.asInstanceOf[SeveralRoutees].routees must be(
|
||||
|
|
@ -118,16 +118,16 @@ class CustomRouterDocSpec extends AkkaSpec(CustomRouterDocSpec.config) with Impl
|
|||
|
||||
"demonstrate usage of custom router" in {
|
||||
//#usage-1
|
||||
for (n ← 1 to 10) system.actorOf(Props[Storage], "s" + n)
|
||||
for (n <- 1 to 10) system.actorOf(Props[Storage], "s" + n)
|
||||
|
||||
val paths = for (n ← 1 to 10) yield ("/user/s" + n)
|
||||
val paths = for (n <- 1 to 10) yield ("/user/s" + n)
|
||||
val redundancy1: ActorRef =
|
||||
system.actorOf(RedundancyGroup(paths, nbrCopies = 3).props(),
|
||||
name = "redundancy1")
|
||||
redundancy1 ! "important"
|
||||
//#usage-1
|
||||
|
||||
for (_ ← 1 to 3) expectMsg("important")
|
||||
for (_ <- 1 to 3) expectMsg("important")
|
||||
|
||||
//#usage-2
|
||||
val redundancy2: ActorRef = system.actorOf(FromConfig.props(),
|
||||
|
|
@ -135,7 +135,7 @@ class CustomRouterDocSpec extends AkkaSpec(CustomRouterDocSpec.config) with Impl
|
|||
redundancy2 ! "very important"
|
||||
//#usage-2
|
||||
|
||||
for (_ ← 1 to 5) expectMsg("very important")
|
||||
for (_ <- 1 to 5) expectMsg("very important")
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -173,9 +173,9 @@ router-dispatcher {}
|
|||
}
|
||||
|
||||
def receive = {
|
||||
case w: Work ⇒
|
||||
case w: Work =>
|
||||
router.route(w, sender)
|
||||
case Terminated(a) ⇒
|
||||
case Terminated(a) =>
|
||||
router = router.removeRoutee(a)
|
||||
val r = context.actorOf(Props[Worker])
|
||||
context watch r
|
||||
|
|
@ -186,7 +186,7 @@ router-dispatcher {}
|
|||
|
||||
class Worker extends Actor {
|
||||
def receive = {
|
||||
case _ ⇒
|
||||
case _ =>
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -199,7 +199,7 @@ router-dispatcher {}
|
|||
//#create-worker-actors
|
||||
|
||||
def receive = {
|
||||
case _ ⇒
|
||||
case _ =>
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -335,14 +335,14 @@ router-dispatcher {}
|
|||
//#resize-pool-2
|
||||
|
||||
def receive = {
|
||||
case _ ⇒
|
||||
case _ =>
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class Echo extends Actor {
|
||||
def receive = {
|
||||
case m ⇒ sender ! m
|
||||
case m => sender ! m
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue