Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Flow/Sink#foldWhile operator. #1012

Merged
merged 1 commit into from
Jan 22, 2024
Merged

feat: Add Flow/Sink#foldWhile operator. #1012

merged 1 commit into from
Jan 22, 2024

Conversation

He-Pin
Copy link
Member

@He-Pin He-Pin commented Jan 21, 2024

Motivation:
When chating with @GreyPlane and @laglangyue for implementing the forAll and exists, I find pekko stream needs a foldWhile operator, which can help with that.

refs: #1010

Result:
Richer operators set.

@He-Pin He-Pin added the t:stream Pekko Streams label Jan 21, 2024
@He-Pin He-Pin added this to the 1.1.0 milestone Jan 21, 2024
@He-Pin He-Pin marked this pull request as draft January 21, 2024 15:01
@He-Pin He-Pin marked this pull request as ready for review January 21, 2024 15:40
Copy link
Member

@Roiocam Roiocam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a quick review, found some encoding issue.

@Roiocam
Copy link
Member

Roiocam commented Jan 22, 2024

Just a quick review, found some encoding issues.

Verify on my laptop, looks like these comments aren't correct.

[error] Error writing content: template resulted in an invalid URL [org.apache.pekko.stream.scaladsl.Sink$#foldWhile[U, T](zero: U)(p: U => Boolean)(f: (U, T) => U):org.apache.pekko.stream.scaladsl.Sink[T,scala.concurrent.Future[U]]]. Try percent-encoding manually some of the reserved characters, for example: [org.apache.pekko.stream.scaladsl.Sink$#foldWhile%5BU, T](zero: U)(p: U =%3E Boolean)(f: (U, T) =%3E U):org.apache.pekko.stream.scaladsl.Sink%5BT,scala.concurrent.Future%5BU]]]. See https://github.com/lightbend/sbt-paradox-apidoc/pull/130 for more details. at /Users/roiocam/IdeaProject/incubator-pekko/docs/src/main/paradox/stream/operators/Sink/foldWhile.md
[error] Error writing content: template resulted in an invalid URL [org.apache.pekko.stream.scaladsl.Source#foldWhile[T](zero:T)(p: T => Boolean)(f: (T, Out) => T):FlowOps.this.Repr[T]]. Try percent-encoding manually some of the reserved characters, for example: [org.apache.pekko.stream.scaladsl.Source#foldWhile%5BT](zero:T)(p: T =%3E Boolean)(f: (T, Out) =%3E T):FlowOps.this.Repr%5BT]]. See https://github.com/lightbend/sbt-paradox-apidoc/pull/130 for more details. at /Users/roiocam/IdeaProject/incubator-pekko/docs/src/main/paradox/stream/operators/Source-or-Flow/foldWhile.md
[error] Paradox failed with 2 errors
[error] (docs / Compile / paradoxMarkdownToHtml) com.lightbend.paradox.sbt.ParadoxPlugin$ParadoxException
[error] Total time: 743 s (12:23), completed 2024-1-22 11:14:50

@He-Pin
Copy link
Member Author

He-Pin commented Jan 22, 2024

@Roiocam Thanks, I was checked paradoxBrowse , unknow why :)

@@ -67,6 +67,7 @@ class DslFactoriesConsistencySpec extends AnyWordSpec with Matchers {
(classOf[scala.Function0[_]], classOf[pekko.japi.function.Creator[_]]) ::
(classOf[scala.Function0[_]], classOf[java.util.concurrent.Callable[_]]) ::
(classOf[scala.Function1[_, Unit]], classOf[pekko.japi.function.Procedure[_]]) ::
(classOf[scala.Function1[_, Boolean]], classOf[pekko.japi.function.Predicate[_]]) ::
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GreyPlane I added one here.

Copy link
Contributor

@mdedetrich mdedetrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed some typos, I would go over the documentation once more to make sure I also didn't miss anything.

Otherwise lgtm

docs/src/main/paradox/stream/operators/index.md Outdated Show resolved Hide resolved
Copy link
Member

@jxnu-liguobin jxnu-liguobin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@mdedetrich mdedetrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@He-Pin He-Pin merged commit 2431eb4 into apache:main Jan 22, 2024
18 checks passed
@He-Pin He-Pin deleted the fold branch January 22, 2024 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t:stream Pekko Streams
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants