Created
December 2, 2017 23:32
-
-
Save nambrot/8a08575358adbdbeb60457f24f8a6f31 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
val g = RunnableGraph.fromGraph(GraphDSL.create() { implicit b: GraphDSL.Builder[NotUsed] => | |
import GraphDSL.Implicits._ | |
val merger = b.add(Merge[(List[BloodPressureEvent], List[HeartRateEvent])](2)) | |
bloodPressureSource.map(toEvent[BloodPressureEvent]).map(event => (List(event), List())) ~> merger.in(0) | |
heartRateSource.map(toEvent[HeartRateEvent]).map(event => (List(), List(event))) ~> merger.in(1) | |
merger ~> Sink.foreach(println) | |
ClosedShape | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment