In working with graphs you have an example of a partial graph that doesn’t make a ton of sense to me.
val pickMaxOfThree = GraphDSL.create() { implicit b ⇒
import GraphDSL.Implicits._
val zip1 = b.add(ZipWith[Int, Int, Int](math.max _))
val zip2 = b.add(ZipWith[Int, Int, Int](math.max _))
zip1.out ~> zip2.in0
UniformFanInShape(zip2.out, zip1.in0, zip1.in1, zip2.in1)
}
wouldn’t zip1.in2 and zip2.in2 be unbound in this example? and why are two ZipWiths needed at all, wouldn’t the first pick the max of the three inputs already?
Yes, ZipWith has generated versions for many inputs – though the purpose of that specific example is more to teach about how to combine things in the advanced graph DSL and the predefined shapes rather than showing ZipWith specifically – but yeah, you’re absolutely right.
Thanks for asking this question. I was confused about the same example, and the drawing our made @tg44 helped a lot! Is there a way to add such drawings to the documentation?
We would want nice diagrams but we have yet to decide how, there is an issue discussing how we can add nice diagrams without it becoming too work intense to maintain/get to work here: https://github.com/akka/akka/issues/24933