Open shekhargulati opened 7 years ago
Line 145: This meant
App1ControlActorcan successfully does not have to wait for JVM to exit.
Missing shut down and
between successfully and does not
@jotomo thanks. I have incorporated the feedback.
Hi,
you could have used sys.addShutdownHook
from scala.sys
package object which is a nice scala wrapper over java Runtime.getRuntime.addShutdownHook
.
So basically instead of this:
Runtime.getRuntime.addShutdownHook(new Thread(new Runnable {
override def run(): Unit = {
val terminate: Future[Terminated] = system.terminate()
Await.result(terminate, Duration("10 seconds"))
}
}))
you can do this:
sys.addShutdownHook {
val terminate: Future[Terminated] = system.terminate()
Await.result(terminate, Duration("10 seconds"))
}
which looks nicer (less boilderplate) ;).
Please provide your feedback by posting a comment against this issue.