Quantcast
Channel: Akka Libraries - Discussion Forum for Akka technologies
Viewing all articles
Browse latest Browse all 1362

Application exit code to reflect actor system shutdown cause

$
0
0

What is the best way to have application exit code reflect actor system shutdown cause? The code below reflects the idea, but does not work (it’s always Success(Done)).

sealed trait AppProtocol
val appDef = setup[AppProtocol] { ctx =>
  ...
}

ActorSystem(appDef, "app", config).whenTerminated.onComplete {
  case Success(Done) =>
    sys.exit()
  case Failure(cause) =>
    logger.error(s"actor system critical error: ${cause.getMessage}", cause)
    sys.exit(1)
}

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 1362

Trending Articles