Slide 70
Slide 70 text
GRAPH
def graph(source : Source[PropertyChange, NotUsed],
process : Flow[PropertyChange, Either[ValidationError, AdwordsChange], NotUsed],
store : Sink[AdwordsChange, Future[Done]],
errorSink: Sink[AdwordsStreamError, NotUsed]): RunnableGraph[Future[Done]] = {
RunnableGraph.fromGraph(GraphDSL.create(store) {
implicit builder ⇒ store ⇒
val p = builder.add(PartitionEither.apply()[ValidationError, AdwordsChange])
p.out0 ~> errorSink
source ~> process ~> p.in
p.out1 ~> store
ClosedShape
})
}