El futuro no está completo?
object Executor extends App {
implicit val system = ActorSystem()
implicit val materializer = ActorMaterializer()
implicit val ec = system.dispatcher
import akka.stream.io._
val file = new File("res/AdviceAnimals.tsv")
import akka.stream.io.Implicits._
val foreach: Future[Long] = SynchronousFileSource(file)
.to( Sink.outputStream(()=>System.out))
.run()
foreach onComplete { v =>
println(s"the foreach is ${v.get}") // the will not be print
}
}
pero si cambio elSink.outputStream(()=>System.out)
aSink.ignore
, elprintln(s"the foreach is ${v.get}")
se imprimirá
¿Alguien puede explicar por qué?