I'm trying out some stuff with Akka Streams for one of my project where I already use Rx Scala. I was tempted to see how Akka Streams would be a fit to replace the Rx Scala library that we have. One thing what I do not see possible with Akka Streams is the possibility to have one Source and many Sinks. Say, in this example taken straight out from Akka Streams documentation:
val source = Source(1 to 10)
val sink = Sink.fold[Int, Int](0)(_ + _)
// connect the Source to the Sink, obtaining a RunnableGraph
val runnable: RunnableGraph[Future[Int]] = source.toMat(sink)(Keep.right) // how could I materialize to a Seq of Sinks?
// materialize the flow and get the value of the FoldSink
val sum: Future[Int] = runnable.run()
When using an Rx library, I have both the Source (Observable) and Sink (Observer) totally decoupled which gives me the flexibility to map 1 Source (Observable)and have n Sinks (Observers). How can I achieve this with the Akka Streams? Any pointers would be helpful!