Hi,
Need suggestion, I need to run parallel multiple source graphs, for example
I have created this sample code where I am creating 10 graphs and running
them parallel.
Is this right approach or should I create multiple source inside a graph
and run them parallel in one graph?
def createGraph(start: Int, end: Int, name: String) = {
RunnableGraph.fromGraph(GraphDSL.create() {
implicit builder =>
import GraphDSL.Implicits._
val s = Source(start to end)
val f = Flow[Int].map[String](x => x.toString)
val sink = Sink.foreach[String](x => println(name + ":" + x))
val t = builder.add(s)
val flow1 = builder.add(f)
t ~> flow1 ~> sink
ClosedShape
})
}
(1 to 10).map(x => createGraph(x, x + 10, "g" + x)).map(_.run())
Thanks & Regards,
Arun
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.