Hi Jakub, (Please remove the formatting from IntelliJ next time, it is hard to read in Gmail)
On Thu, May 28, 2015 at 12:18 PM, Jakub Liska <liska.ja...@gmail.com> wrote: > Hi, > > I cannot figure out, how would I do something like : > > bucketOpt match { > case None => > *// ??? How to return just a dummy partial graph ???* > case Some(bucket) => > Flow() { implicit b => > import FlowGraph.Implicits._ > > val broadcast = b.add(Broadcast[Array[ResCtx]](2)) > > val uniqueResourceFilter = Flow[Array[ResCtx]].transform(() => new > UniqueResourceFilter) > val backup = Flow[Iterable[Resource]].mapAsyncUnordered(4) { resources > => > Future.sequence( > resources.map( res => S3BackupFlow.backup(bucket, res, res.name, > deleteLocal)) > ) > } > broadcast.out(0) ~> uniqueResourceFilter ~> backup ~> Sink.ignore > > (broadcast.in, broadcast.out(1)) > } > } > > > Since you return just a Flow, why don't you just create an empty Flow? I.e Flow[Array[ResCtx]] > Also it is a mystery to me how to grab just an inlet stream, for doing > something like : > > Flow() { implicit b => > import FlowGraph.Implicits._ > > > > val uniqueResourceFilter = Flow[Array[ResCtx]].transform(() => new > UniqueResourceFilter) > > val merge = b.add(Merge[Array[ResCtx]](2)) > > > > ???in??? ~> filter ~> broadcast.out(0) ~> uniqueResourceFilter ~> backup ~> > merge.in(0) > > ~> broadcast.out(1) ~> uniqueResourceFilter ~> backup ~> > merge.in(1) > > > (???in???, merge.out) > } > > > You can always do: val f = b.add(filter) f.out ~> broadcast ... (f.in, merge.out) Flows/Sources/Sinks have this little feature that you don't need to import them explicitly like I did above, but that does not mean you can't import them explicitly. -Endre > > Thanks, Jakub > > -- > >>>>>>>>>> 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 akka-user+unsubscr...@googlegroups.com. > To post to this group, send email to akka-user@googlegroups.com. > Visit this group at http://groups.google.com/group/akka-user. > For more options, visit https://groups.google.com/d/optout. > -- >>>>>>>>>> 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 akka-user+unsubscr...@googlegroups.com. To post to this group, send email to akka-user@googlegroups.com. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.