replace unicode arrows
* ⇒, →, ← * because we don't want to show them in documentation snippets and then it's complicated to avoid that when snippets are located in src/test/scala in individual modules * dont replace object `→` in FSM.scala and PersistentFSM.scala
This commit is contained in:
parent
e4d38f92a4
commit
5c96a5f556
1521 changed files with 18846 additions and 18786 deletions
|
|
@ -33,8 +33,8 @@ class FlowErrorDocSpec extends AkkaSpec {
|
|||
"demonstrate resume stream" in {
|
||||
//#resume
|
||||
val decider: Supervision.Decider = {
|
||||
case _: ArithmeticException ⇒ Supervision.Resume
|
||||
case _ ⇒ Supervision.Stop
|
||||
case _: ArithmeticException => Supervision.Resume
|
||||
case _ => Supervision.Stop
|
||||
}
|
||||
implicit val materializer = ActorMaterializer(
|
||||
ActorMaterializerSettings(system).withSupervisionStrategy(decider))
|
||||
|
|
@ -51,11 +51,11 @@ class FlowErrorDocSpec extends AkkaSpec {
|
|||
//#resume-section
|
||||
implicit val materializer = ActorMaterializer()
|
||||
val decider: Supervision.Decider = {
|
||||
case _: ArithmeticException ⇒ Supervision.Resume
|
||||
case _ ⇒ Supervision.Stop
|
||||
case _: ArithmeticException => Supervision.Resume
|
||||
case _ => Supervision.Stop
|
||||
}
|
||||
val flow = Flow[Int]
|
||||
.filter(100 / _ < 50).map(elem ⇒ 100 / (5 - elem))
|
||||
.filter(100 / _ < 50).map(elem => 100 / (5 - elem))
|
||||
.withAttributes(ActorAttributes.supervisionStrategy(decider))
|
||||
val source = Source(0 to 5).via(flow)
|
||||
|
||||
|
|
@ -71,11 +71,11 @@ class FlowErrorDocSpec extends AkkaSpec {
|
|||
//#restart-section
|
||||
implicit val materializer = ActorMaterializer()
|
||||
val decider: Supervision.Decider = {
|
||||
case _: IllegalArgumentException ⇒ Supervision.Restart
|
||||
case _ ⇒ Supervision.Stop
|
||||
case _: IllegalArgumentException => Supervision.Restart
|
||||
case _ => Supervision.Stop
|
||||
}
|
||||
val flow = Flow[Int]
|
||||
.scan(0) { (acc, elem) ⇒
|
||||
.scan(0) { (acc, elem) =>
|
||||
if (elem < 0) throw new IllegalArgumentException("negative not allowed")
|
||||
else acc + elem
|
||||
}
|
||||
|
|
@ -93,11 +93,11 @@ class FlowErrorDocSpec extends AkkaSpec {
|
|||
"demonstrate recover" in {
|
||||
implicit val materializer = ActorMaterializer()
|
||||
//#recover
|
||||
Source(0 to 6).map(n ⇒
|
||||
Source(0 to 6).map(n =>
|
||||
if (n < 5) n.toString
|
||||
else throw new RuntimeException("Boom!")
|
||||
).recover {
|
||||
case _: RuntimeException ⇒ "stream truncated"
|
||||
case _: RuntimeException => "stream truncated"
|
||||
}.runForeach(println)
|
||||
//#recover
|
||||
|
||||
|
|
@ -119,11 +119,11 @@ stream truncated
|
|||
//#recoverWithRetries
|
||||
val planB = Source(List("five", "six", "seven", "eight"))
|
||||
|
||||
Source(0 to 10).map(n ⇒
|
||||
Source(0 to 10).map(n =>
|
||||
if (n < 5) n.toString
|
||||
else throw new RuntimeException("Boom!")
|
||||
).recoverWithRetries(attempts = 1, {
|
||||
case _: RuntimeException ⇒ planB
|
||||
case _: RuntimeException => planB
|
||||
}).runForeach(println)
|
||||
//#recoverWithRetries
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue