Sink.combine
Combine several sinks into one using a user specified strategy
Signature
Description
Combine several sinks into one using a user specified strategy
Example
This example shows how to combine multiple sinks with a Fan-out Junction.
- Scala
-
source
val sendRemotely = Sink.actorRef(actorRef, "Done", _ => "Failed") val localProcessing = Sink.foreach[Int](_ => /* do something useful */ ()) val sink = Sink.combine(sendRemotely, localProcessing)(Broadcast[Int](_)) Source(List(0, 1, 2)).runWith(sink)
- Java
Reactive Streams semantics
cancels depends on the strategy
backpressures depends on the strategy