pekko/akka-docs/src/test/scala/tutorial_5/IotApp.scala

30 lines
618 B
Scala
Raw Normal View History

2017-02-27 10:09:36 +01:00
/**
* Copyright (C) 2009-2017 Lightbend Inc. <http://www.lightbend.com>
*/
2017-03-30 11:42:52 +02:00
package tutorial_5
2017-02-27 10:09:36 +01:00
import akka.actor.ActorSystem
2017-03-30 11:42:52 +02:00
import tutorial_5.DeviceManager.RequestTrackDevice
2017-02-27 10:09:36 +01:00
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()
}
}
}