Guest User

Untitled

a guest
Jun 22nd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. object Main {
  2. private def runWithVanilla() = {
  3. import scala.concurrent.ExecutionContext.Implicits.global
  4. val f = Future(throw new OutOfMemoryError("foop"))
  5. Await.result(f,Duration.Inf)
  6. println("vanilla future completed? " + f.isCompleted)
  7. }
  8.  
  9. private def runWithAkka() = {
  10. val system = ActorSystem("mySystem")
  11. import system.dispatcher
  12. val f = Future(throw new OutOfMemoryError("foop"))
  13. Await.result(f,Duration.Inf)
  14. println("akka dispatched future completed? " + f.isCompleted)
  15. }
  16.  
  17. def main(args: Array[String]): Unit = {
  18. // runWithVanilla()
  19. runWithAkka()
  20. }
  21. }
Add Comment
Please, Sign In to add comment