You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "BH-M87 (via GitHub)" <gi...@apache.org> on 2025/04/20 16:16:48 UTC

[PR] feat: Add BufferUntilChanged functionality for Java and Scala streams [pekko]

BH-M87 opened a new pull request, #1824:
URL: https://github.com/apache/pekko/pull/1824

   (no comment)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] feat: Add BufferUntilChanged functionality for Java and Scala streams [pekko]

Posted by "raboof (via GitHub)" <gi...@apache.org>.
raboof commented on PR #1824:
URL: https://github.com/apache/pekko/pull/1824#issuecomment-2820334292

   for reference https://www.apache.org/legal/generative-tooling.html


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] feat: Add BufferUntilChanged functionality for Java and Scala streams [pekko]

Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin closed pull request #1824: feat: Add BufferUntilChanged functionality for Java and Scala streams
URL: https://github.com/apache/pekko/pull/1824


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] feat: Add BufferUntilChanged functionality for Java and Scala streams [pekko]

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on code in PR #1824:
URL: https://github.com/apache/pekko/pull/1824#discussion_r2051775932


##########
stream-tests/src/test/java/org/apache/pekko/stream/javadsl/BufferUntilChangedTest.java:
##########
@@ -0,0 +1,116 @@
+/*

Review Comment:
   this is the wrong header unless you have copied this code from somewhere else - the right header for 100% new code is https://github.com/apache/pekko/blob/main/project/AddMetaInfLicenseFiles.scala#L1-L16



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] feat: Add BufferUntilChanged functionality for Java and Scala streams [pekko]

Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on PR #1824:
URL: https://github.com/apache/pekko/pull/1824#issuecomment-2817453397

   Hi @pjfanning THIS PR is totally done with Ai llm, so we need take careful about merge it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] feat: Add BufferUntilChanged functionality for Java and Scala streams [pekko]

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on code in PR #1824:
URL: https://github.com/apache/pekko/pull/1824#discussion_r2051776092


##########
stream/src/main/scala/org/apache/pekko/stream/javadsl/SubFlow.scala:
##########
@@ -714,6 +714,40 @@ class SubFlow[In, Out, Mat](
   def sliding(n: Int, step: Int = 1): SubFlow[In, java.util.List[Out @uncheckedVariance], Mat] =
     new SubFlow(delegate.sliding(n, step).map(_.asJava)) // TODO optimize to one step
 
+  /**
+   * Collect subsequent repetitions of an element (that is, if they arrive right after one another) into multiple
+   * `List` buffers that will be emitted by the resulting SubFlow.
+   *
+   * @return a SubFlow that buffers elements until they change

Review Comment:
   add `@since 1.2.0` to new public methods



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] feat: Add BufferUntilChanged functionality for Java and Scala streams [pekko]

Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on PR #1824:
URL: https://github.com/apache/pekko/pull/1824#issuecomment-2820142245

   let's close this to keep a clean room


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] feat: Add BufferUntilChanged functionality for Java and Scala streams [pekko]

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on code in PR #1824:
URL: https://github.com/apache/pekko/pull/1824#discussion_r2051776147


##########
stream/src/main/java/org/apache/pekko/stream/javadsl/BufferUntilChanged.java:
##########
@@ -0,0 +1,113 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * license agreements; and to You under the Apache License, version 2.0:
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ */
+
+package org.apache.pekko.stream.javadsl;
+
+import org.apache.pekko.NotUsed;
+import org.apache.pekko.annotation.ApiMayChange;
+import org.apache.pekko.japi.function.Function;
+import org.apache.pekko.japi.function.Function2;
+import org.apache.pekko.stream.javadsl.Flow;
+import org.apache.pekko.stream.javadsl.Source;
+
+import java.util.List;
+
+/**
+ * Java API: Additional buffer operations for Flow and Source.
+ */
+public final class BufferUntilChanged {
+
+    private BufferUntilChanged() {}
+
+    /**
+     * Collect subsequent repetitions of an element (that is, if they arrive right after one another) into multiple
+     * `List` buffers that will be emitted by the resulting Flow.
+     *
+     * @param <T> the element type
+     * @return a Flow that buffers elements until they change
+     */
+    @ApiMayChange
+    public static <T> Flow<T, List<T>, NotUsed> flow() {
+        return Flow.<T>create().asScala().bufferUntilChanged().asJava();
+    }
+
+    /**
+     * Collect subsequent repetitions of an element (that is, if they arrive right after one another), as compared by a key

Review Comment:
   lines are too long



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] feat: Add BufferUntilChanged functionality for Java and Scala streams [pekko]

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on PR #1824:
URL: https://github.com/apache/pekko/pull/1824#issuecomment-2817269744

   @BH-M87 thanks for the PR. Would it be possible to provide a description of the PR in the PR description. It is not appropriate to leave it blank.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org