Errors only flow downstream. So in order to take a downstream error and make it fail something "upstream"... you'll have to connect that downstream to the upstream so it becomes a downstream :-) I hope that made sense :-)
In general though, you could make a fan-out operation from your downstream, and from it, loop back to the entry of your Graph and connect it there with a fan-in operation, which if if fails would fail "downstream" into the graph getting you what you asked for. Stepping back though – why do you need this? -- Cheers, Konrad 'ktoso’ Malawski Akka @ Typesafe On 16 February 2016 at 21:12:38, David Knapp ([email protected]) wrote: I asked this on SO without any responses. Thought I'd x-post here. I'm wondering if there's any sane way to make this graph fail, or if I'm just thinking about this in the entirely wrong way: def flow(n: String) = Flow[Int].map{v => println(s"$n: $v"); v + 1} val g = Source.fromGraph(GraphDSL.create() { implicit b => import GraphDSL.Implicits._ val broadcast = b.add(Broadcast[Int](2)) val source = b.add(Source.single(1)) source ~> flow("A") ~> broadcast broadcast.out(1) ~> flow("B") ~> flow("C").mapAsync(1){ _ => Future.failed(new Exception())} ~> Sink.foreach[Int](f => println("OK")) SourceShape(broadcast.out(0)) }) http://stackoverflow.com/questions/35420779/failing-an-akka-stream-graph-if-a-downstream-branch-fails -- >>>>>>>>>> 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. -- >>>>>>>>>> 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.
