This is an automated email from the ASF dual-hosted git repository.
hepin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko.git
The following commit(s) were added to refs/heads/main by this push:
new 31ece7bfcc chore: Add missing scala doc for watchTermination operator.
(#2368)
31ece7bfcc is described below
commit 31ece7bfcc5974026b7a90026153463cba6f4623
Author: He-Pin(kerr) <[email protected]>
AuthorDate: Sat Oct 25 20:52:13 2025 +0800
chore: Add missing scala doc for watchTermination operator. (#2368)
---
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]