package eu.xeppaka.scalalearn

import akka.actor.{ActorSystem, PoisonPill, Props}
import akka.stream.ActorMaterializer
import eu.xeppaka.scalalearn.ActorTest1.Print

import scala.concurrent.Await
import scala.concurrent.duration._
import scala.io.StdIn

object Main6 {
  def main(args: Array[String]): Unit = {
    val actorSystem = ActorSystem()
    implicit val materializer: ActorMaterializer = ActorMaterializer()(actorSystem)

    val actor = actorSystem.actorOf(Props(new ActorTest1))
    actor ! Print
    //actor ! PoisonPill
    actor ! Print

    StdIn.readLine()
    Await.ready(actorSystem.terminate(), 5.seconds)
  }
}
