I\'m building a REST API that starts some calculation in a Spark cluster and responds with a chunked stream of the results. Given the Spark stream with calculation results,
Not sure about the version of api at the time of the question. But now, with akka-stream 2.0.3, I believe you can do it like:
val source = Source .actorRef[T](/* buffer size */ 100, OverflowStrategy.dropHead) .mapMaterializedValue[Unit] { actorRef => dstream.foreach(actorRef ! _) }