fix up two oversights in previous doc change
- use discardOld=false also in Scala stash sample code - correct link to UnnestedReceives sample
This commit is contained in:
parent
4acd483ed3
commit
d98c4db1f9
3 changed files with 4 additions and 4 deletions
|
|
@ -113,7 +113,7 @@ class ActorDSLSpec extends AkkaSpec {
|
||||||
case "info" ⇒ sender ! "B"
|
case "info" ⇒ sender ! "B"
|
||||||
case "switch" ⇒ unbecome() // return to the "A" behavior
|
case "switch" ⇒ unbecome() // return to the "A" behavior
|
||||||
}
|
}
|
||||||
case "lobotomize" => unbecome() // OH NOES: Actor.emptyBehavior
|
case "lobotomize" ⇒ unbecome() // OH NOES: Actor.emptyBehavior
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
//#becomeStacked
|
//#becomeStacked
|
||||||
|
|
|
||||||
|
|
@ -696,7 +696,7 @@ behavior is not the default).
|
||||||
Encoding Scala Actors nested receives without accidentally leaking memory
|
Encoding Scala Actors nested receives without accidentally leaking memory
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
See this `Unnested receive example <@github@/akka-docs/scala/code/docs/actor/UnnestedReceives.scala>`_.
|
See this `Unnested receive example <@github@/akka-docs/rst/scala/code/docs/actor/UnnestedReceives.scala>`_.
|
||||||
|
|
||||||
|
|
||||||
Stash
|
Stash
|
||||||
|
|
|
||||||
|
|
@ -316,13 +316,13 @@ class ActorDocSpec extends AkkaSpec(Map("akka.loglevel" -> "INFO")) {
|
||||||
def receive = {
|
def receive = {
|
||||||
case "open" ⇒
|
case "open" ⇒
|
||||||
unstashAll()
|
unstashAll()
|
||||||
context.become {
|
context.become({
|
||||||
case "write" ⇒ // do writing...
|
case "write" ⇒ // do writing...
|
||||||
case "close" ⇒
|
case "close" ⇒
|
||||||
unstashAll()
|
unstashAll()
|
||||||
context.unbecome()
|
context.unbecome()
|
||||||
case msg ⇒ stash()
|
case msg ⇒ stash()
|
||||||
}
|
}, discardOld = false) // stack on top instead of replacing
|
||||||
case msg ⇒ stash()
|
case msg ⇒ stash()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue