Merge akka-docs/paradox/scala/actors.md and java/actors.md (#23079)

* Identical contents in scala/actors.md and java/actors.md
* Replace java/actors.md with a symlink to scala/actors.md
This commit is contained in:
Richard Imaoka 2017-06-03 22:34:22 +09:00 committed by Arnout Engelen
parent fb3e42f2e8
commit c569bdbc7c
5 changed files with 489 additions and 1188 deletions

View file

@ -310,6 +310,13 @@ class Ponger(pinger: ActorRef) extends Actor {
//#fiddle_code
//#immutable-message-definition
case class User(name: String)
// define the case class
case class Register(user: User)
//#immutable-message-definition
class ActorDocSpec extends AkkaSpec("""
akka.loglevel = INFO
akka.loggers = []
@ -381,6 +388,23 @@ class ActorDocSpec extends AkkaSpec("""
system.terminate()
}
"instantiates a case class" in {
//#immutable-message-instantiation
val user = User("Mike")
// create a new case class message
val message = Register(user)
//#immutable-message-instantiation
}
"use poison pill" in {
val victim = system.actorOf(Props[MyActor])
//#poison-pill
watch(victim)
victim ! PoisonPill
//#poison-pill
expectTerminated(victim)
}
"creating a Props config" in {
//#creating-props
import akka.actor.Props
@ -562,10 +586,12 @@ class ActorDocSpec extends AkkaSpec("""
}
}
//#watch
val a = system.actorOf(Props(classOf[WatchActor], this))
val victim = system.actorOf(Props(classOf[WatchActor], this))
implicit val sender = testActor
a ! "kill"
//#kill
victim ! "kill"
expectMsg("finished")
//#kill
}
}