Quantcast
Channel: Akka Stream - simple source/sink example inlets and outlets do not correspond - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Answer by 0__ for Akka Stream - simple source/sink example inlets and outlets do not correspond

$
0
0

It seems one has to use a special "copy" of the outlet that one gets from builder.add:

  val graph = GraphDSL.create() { implicit b =>
    val in  = Source.fromIterator(() => (1 to 10).iterator.map(_.toDouble))
    val out = Sink.foreach[Double] { d =>
      println(s"elem: $d")
    }
    import GraphDSL.Implicits._
    val inOutlet = b.add(in).out
    // ... pass inOutlet around until ...
    inOutlet ~> out
    ClosedShape
  }

Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>