[akka-user] Using zip with mapAsyncUnordered

2017-08-26 Thread Ori Popowski
Hi, Say that I have a stream with a consecutive integers source (1, 2, 3 ...), and assume that toString returns a Future[String]: source ~> bcast ~> toString.mapAsyncUnordered(8)(identity) ~> zip.in0 bcast ~>zip.in1

[akka-user] Source of Future[Option[A]]

2017-09-11 Thread Ori Popowski
Hi, What is the correct way to create a source from a function which returns Future[Option[A]], besides a custom GraphStage? The source should emit A elements (not wrapped in Future[Option[]]). I considered a few options, none of them worked *First: using RestartSource* RestartSource.withBack

[akka-user] Akka Streams - Source.map vs Source.via(flow)

2016-09-05 Thread Ori Popowski
Hi, It may seem like a trivial question, but I'm a bit confused about use cases of Source.map vs. Source.via(flow). For example, these two flows produce the exact same output: val flow1 = Source(1 to 10).map(_ * 2).to(Sink.foreach(println)) val flow2 = Source(1 to 10).via(Flow[Int].map(

[akka-user] Stream gets stuck when GraphStage[SourceShape] has no more elements

2016-09-07 Thread Ori Popowski
Hi, We have a GraphStage[SourceShape[?]] with a simple OutHandler which does the following: 1. Finds a document in MongoDB 2. Pushes that document to the outlet using push() It's possible that the source will not find any documents in the DB at a given moment, but new documents may be ar

Re: [akka-user] Akka Streams - Source.map vs Source.via(flow)

2016-09-17 Thread Ori Popowski
le map this is an overkill of course (btw .map() is converted to > a .via() without you seeing it ;) ) > > -Endre > > On Mon, Sep 5, 2016 at 9:30 AM, Ori Popowski > wrote: > >> Hi, >> >> It may seem like a trivial question, but I'm a bit confused about use

[akka-user] Re: Stream gets stuck when GraphStage[SourceShape] has no more elements

2016-09-17 Thread Ori Popowski
en better, to check the Akka Stream > source code. I am not used to read scala code, but I was able to understand > the standard flow stages on the github repository, so I am sure you can do > it. > > Bests, > > Gonzalo > > El miƩrcoles, 7 de septiembre de 2016, 10:37