Created
October 9, 2014 09:39
-
-
Save ktoso/a8aca7b3563ff7b44a6f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final Flow<String, String> f1 = Flow.of(String.class).transform("f1", this.<String, String>op()); // javadsl | |
final Flow<String, String> f2 = Flow.of(String.class).transform("f2", this.<String, String>op()); // javadsl | |
final Flow<String, String> f3 = Flow.of(String.class).transform("f2", this.<String, String>op()); // javadsl | |
// TODO what do we want to do here, so scaladsl does not leak into javadls usage via using Taps? | |
final IterableTap<String> in1 = new IterableTap<String>(Util.immutableSeq(Arrays.asList("a", "b", "c"))); // scaladsl | |
final IterableTap<String> in2 = new IterableTap<String>(Util.immutableSeq(Arrays.asList("d", "e", "f"))); // scaladsl | |
final PublisherDrain<String> out1 = new PublisherDrain<String>(); | |
final FutureDrain<String> out2 = new FutureDrain<String>(); | |
// TODO FLOW GRAPH | |
JavaFlowGraph.construct(new BobTheBuilder() { | |
@Override | |
public JavaFlowGraph connect(JavaFlowGraphBuilder b) { | |
Merge<String> merge = Merge.apply(); | |
return b. | |
addEdge(in1, f1, merge). // would rather use in1/in3 as javadsl | |
addEdge(in2, f2, merge). | |
addEdge(merge, f3, out1); | |
} | |
}).run(materializer); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment