What do you mean? It does produce output, I just tried it out. Also, don't use Stream.from, use Iterator.from instead as the former retains elements while the latter does not.
-Endre On Wed, Apr 13, 2016 at 4:00 PM, Rajeev Kumar <[email protected]> wrote: > I am just playing with examples given on akka stream documentation page : > http://doc.akka.io/docs/akka/2.4.2/scala/stream/stream-graphs.html > > > My akka stream version in SBT file : > > > val akkaVersion = "2.3.7" > val httpVersion = "2.0.4" > > libraryDependencies ++= Seq( > "com.typesafe.akka" %% "akka-actor" % "2.3.11", > "com.typesafe.akka" %% "akka-stream-experimental" % httpVersion, > "com.typesafe.akka" %% "akka-http-core-experimental" % httpVersion, > "com.typesafe.akka" %% "akka-http-experimental" % httpVersion, > "com.typesafe.akka" %% "akka-http-spray-json-experimental" % httpVersion > ) > > > Below example taken from there is not producing output. Can someone point > out what is wrong here ? > > > import akka.stream.ClosedShape > > object Test extends App { > > import akka.actor.ActorSystem > import akka.stream.ActorMaterializer > import akka.stream.scaladsl._ > > implicit val system = ActorSystem() > implicit val materializer = ActorMaterializer() > implicit val ec = system.dispatcher > > val source = Source(Stream.from(1)) > > val graph = RunnableGraph.fromGraph(GraphDSL.create() { implicit b => > import GraphDSL.Implicits._ > > val zip = b.add(ZipWith((left: Int, right: Int) => left)) > val bcast = b.add(Broadcast[Int](2)) > val concat = b.add(Concat[Int]()) > val start = Source.single(0) > > source ~> zip.in0 > zip.out.map { s => println(s); s } ~> bcast ~> Sink.ignore > zip.in1 <~ concat <~ start > concat <~ bcast > ClosedShape > }) > > graph.run() > > Thread.sleep(1000000)} > > -- > >>>>>>>>>> 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. > -- Akka Team Typesafe - Reactive apps on the JVM Blog: letitcrash.com Twitter: @akkateam -- >>>>>>>>>> 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.
