=str - #17827 - Introduces operator for Sources and Flows, to attach a Sink in an inline broadcast fashion.

This commit is contained in:
Viktor Klang 2015-10-05 23:20:52 +02:00
parent eee21ac618
commit 08d702faf8
8 changed files with 116 additions and 23 deletions

View file

@ -136,6 +136,11 @@ class FlowDocSpec extends AkkaSpec {
val sink: Sink[Int, Unit] = Flow[Int].map(_ * 2).to(Sink.foreach(println(_)))
Source(1 to 6).to(sink)
// Broadcast to a sink inline
val otherSink: Sink[Int, Unit] =
Flow[Int].alsoTo(Sink.foreach(println(_))).to(Sink.ignore)
Source(1 to 6).to(otherSink)
//#flow-connecting
}