alsoTo
Attaches the given Sink to this Flow, meaning that elements that pass through this Flow will also be sent to the Sink.
Signature
Source.alsoToSource.alsoTo Flow.alsoToFlow.alsoTo
Description
Attaches the given Sink to this Flow, meaning that elements that pass through this Flow will also be sent to the Sink.
By default, cancellation or failure of the attached Sink cancels the main stream. The alsoTo overload with propagateCancellation = false can be used when the attached Sink is a best-effort side sink, such as logging or metrics, and its cancellation or failure should not terminate the main stream. In that mode, the operator still backpressures when the side Sink is active and backpressuring, but once the side Sink cancels or fails, elements continue to the main downstream only.
Reactive Streams semantics
emits when an element is available and demand exists both from the Sink and the downstream
backpressures when downstream or Sink backpressures
completes when upstream completes
cancels when downstream cancels. With the default cancellation propagation, the operator also cancels when the attached Sink cancels or fails. With propagateCancellation = false, cancellation or failure of the attached Sink does not cancel the main stream.