There should be a simple question. I am using Akka 2.4.2 (contains Akka and HTTP streams). I expected this Source to end, and the program will end, because Source course, but it never will be. Why does this program not end?
import scala.concurrent._ import scala.collection.immutable._ import akka._ import akka.actor._ import akka.stream._ import akka.stream.scaladsl._ import akka.util._ object Test extends App { implicit val system = ActorSystem("TestSystem") implicit val materializer = ActorMaterializer() val s = Source.single(1) s.runForeach(println) }
Output:
$ sbt run ... [info] Running Test [DEBUG] [02/23/2016 10:59:19.904] [run-main-0] [EventStream(akka://TestSystem)] logger log1-Logging$DefaultLogger started [DEBUG] [02/23/2016 10:59:19.904] [run-main-0] [EventStream(akka://TestSystem)] Default Loggers started 1
The corresponding part of my build.sbt file build.sbt :
scalaVersion := "2.11.7" scalacOptions := Seq("-unchecked", "-deprecation", "-encoding", "utf8") libraryDependencies ++= { val akkaVersion = "2.4.2" Seq( "com.typesafe.akka" %% "akka-stream" % akkaVersion ) }
akka-stream
Matthew adams
source share