Tutorial pt3

This commit is contained in:
Endre Sándor Varga 2017-03-30 11:42:52 +02:00
parent 8ae34e56f8
commit d90f73e45b
20 changed files with 629 additions and 74 deletions

View file

@ -0,0 +1,29 @@
/**
* Copyright (C) 2009-2017 Lightbend Inc. <http://www.lightbend.com>
*/
package tutorial_5
import akka.actor.ActorSystem
import tutorial_5.DeviceManager.RequestTrackDevice
import scala.io.StdIn
object IotApp {
def main(args: Array[String]): Unit = {
val system = ActorSystem("iot-system")
try {
// Create top level supervisor
val supervisor = system.actorOf(DeviceManager.props(), "iot-supervisor")
supervisor ! RequestTrackDevice("mygroup", "device1")
// Exit the system after ENTER is pressed
StdIn.readLine()
} finally {
system.terminate()
}
}
}