Skip to content

Commit

Permalink
Coorectifs
Browse files Browse the repository at this point in the history
  • Loading branch information
vheaffinitech committed Dec 4, 2015
1 parent 839085d commit 742869a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@ object Main extends App {
implicit val timeout = Timeout(5 seconds)

val future = helloActor ? Msg("hello")
val result = Await.result(future, timeout.duration).asInstanceOf[String]
//val result = Await.result(future, timeout.duration).asInstanceOf[String]
val result = Await.result(future, 1 second).asInstanceOf[String]
println(result)

//another way
val future2: Future[String] = ask(helloActor, Msg("bonjour")).mapTo[String]
val result2 = Await.result(future2, 1 second)
println(result2)

//comment these lines to avoid
helloActor ! StopMsg

system.shutdown()
//system.shutdown()
}

0 comments on commit 742869a

Please sign in to comment.