Well that didn't work at all. onPull gets called continuously before any Futures have been resolved. At this point the only way I know to make it work is to Await the future however then I would be blocking the stream. Any ideas?
On Thursday, December 8, 2016 at 1:21:08 PM UTC-7, [email protected] wrote: > > Hi, > > I'm creating a Source via GraphStageLogic which makes calls to another > api, which happens to return a Source. However I'm unsure how to deal with > Source/Futures in a GraphStageLogic. It seems that I want my shape to look > like > > val shape: SourceShape[Seq[String]] = SourceShape(out) > > > but I get back a Source[ByteString, NotUsed] which I can covert to > Future[Seq[String]] > via runWith(Sink.seq). So should I make my shape > > val shape: SourceShape[Future[Seq[String]]] = SourceShape(out) > > > But then I need to materialize the Source inside the onPull(), which > doesn't seem right. Is there a better way to handle this situation? > > Thanks! > -- >>>>>>>>>> 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.
