I am learning about Akka Streams via the Akka Cookbook module from Packt. I run the TransformingStreamsApplication.scala
example and get this:
To let the actor system exit when the stream processing is completed, I add the following callback:
// Future[IOResult]
val future = stream.run()
future.onComplete(_ => system.terminate())
But this time the application exits directly without any console output:
A workaround I came up with is adding Thread.sleep(10000)
:
I would like an explanation of this behavior.