This is an automated email from the ASF dual-hosted git repository. hepin pushed a commit to branch watchTermination in repository https://gitbox.apache.org/repos/asf/pekko.git
commit be1e867556459b5d4a3272d687119d76634edb17 Author: He-Pin <[email protected]> AuthorDate: Sat Oct 25 20:49:19 2025 +0800 chore: Add missing scala doc for watchTermination operator. --- stream/src/main/scala/org/apache/pekko/stream/javadsl/Flow.scala | 3 +++ stream/src/main/scala/org/apache/pekko/stream/javadsl/Source.scala | 3 +++ 2 files changed, 6 insertions(+) diff --git a/stream/src/main/scala/org/apache/pekko/stream/javadsl/Flow.scala b/stream/src/main/scala/org/apache/pekko/stream/javadsl/Flow.scala index 76a67fca07..13b1c75826 100755 --- a/stream/src/main/scala/org/apache/pekko/stream/javadsl/Flow.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/javadsl/Flow.scala @@ -4159,6 +4159,9 @@ final class Flow[In, Out, Mat](delegate: scaladsl.Flow[In, Out, Mat]) extends Gr * The future completes with success when received complete message from upstream or cancel * from downstream. It fails with the same error when received error message from * downstream. + * + * It is recommended to use the internally optimized `Keep.left` and `Keep.right` combiners + * where appropriate instead of manually writing functions that pass through one of the values. */ def watchTermination[M](matF: function.Function2[Mat, CompletionStage[Done], M]): javadsl.Flow[In, Out, M] = new Flow(delegate.watchTermination()((left, right) => matF(left, right.asJava))) diff --git a/stream/src/main/scala/org/apache/pekko/stream/javadsl/Source.scala b/stream/src/main/scala/org/apache/pekko/stream/javadsl/Source.scala index eda53d59a3..05a63b799c 100755 --- a/stream/src/main/scala/org/apache/pekko/stream/javadsl/Source.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/javadsl/Source.scala @@ -4620,6 +4620,9 @@ final class Source[Out, Mat](delegate: scaladsl.Source[Out, Mat]) extends Graph[ * The Future completes with success when received complete message from upstream or cancel * from downstream. It fails with the same error when received error message from * downstream. + * + * It is recommended to use the internally optimized `Keep.left` and `Keep.right` combiners + * where appropriate instead of manually writing functions that pass through one of the values. */ def watchTermination[M](matF: function.Function2[Mat, CompletionStage[Done], M]): javadsl.Source[Out, M] = new Source(delegate.watchTermination()((left, right) => matF(left, right.asJava))) --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
