Slide 13
Slide 13 text
Akka Actors
val system: ActorSystem = ActorSystem("helloAkka")
val printer: ActorRef = system.actorOf(Printer.props, "printerActor")
val howdyGreeter: ActorRef =
system.actorOf(Greeter.props("Howdy", printer), "howdyGreeter")
val goodDayGreeter: ActorRef =
system.actorOf(Greeter.props("Good day", printer), "goodDayGreeter")
howdyGreeter ! WhoToGreet("Akka")
howdyGreeter ! Greet // Howdy, Akka
howdyGreeter ! WhoToGreet("Scala")
howdyGreeter ! Greet // Howdy, Scala
goodDayGreeter ! WhoToGreet("Play")
goodDayGreeter ! Greet // Good day, Play
2018-11-10 Scala
関西Summit 2018
13