Hey everybody,

I can create a sink that broadcasts incoming messages to a given list of 
sinks. How can I make that sink materialize a future that completes when 
the downstream sinks have completed?

For example,

        final Source<Integer, BoxedUnit> in = Source.from(Arrays.asList(1, 
2, 3, 4, 5));
        final Sink<Integer, Future<BoxedUnit>> s1 = Sink.foreach(t -> 
log.info("first: {}", t));
        final Sink<Integer, Future<BoxedUnit>> s2 = Sink.foreach(t -> 
log.info("second: {}", t));

        // Construct a sink that broadcasts to the sinks s1, s2:
        final Graph<SinkShape<Integer>, *BoxedUnit*> graph = 
GraphDSL.<SinkShape<Integer>> create(
            builder -> {
                final UniformFanOutShape<Integer, Integer> bcast = 
builder.add(Broadcast.create(2));
                final SinkShape<Integer> first = builder.add(s1);
                final SinkShape<Integer> second = builder.add(s2);

                builder.from(bcast).to(first);
                builder.from(bcast).to(second);
                return SinkShape.of(bcast.in());
            });

I'd like graph to be of shape SinkShape<Integer, *Future<BoxedUnit>*>. Is 
that possible?

– Kaspar

-- 
>>>>>>>>>>      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 https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to