=str - #17827 - Introduces operator for Sources and Flows, to attach a Sink in an inline broadcast fashion.
This commit is contained in:
parent
eee21ac618
commit
08d702faf8
8 changed files with 116 additions and 23 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue