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

Add Sink.none operator #1613

Closed
He-Pin opened this issue Dec 19, 2024 · 1 comment
Closed

Add Sink.none operator #1613

He-Pin opened this issue Dec 19, 2024 · 1 comment
Labels
t:stream Pekko Streams
Milestone

Comments

@He-Pin
Copy link
Member

He-Pin commented Dec 19, 2024

Motivation:
When took a look at the current PR in Kotlin Flow, I think we should have this operator too.
Sink#none operator will just works as the Java's Stream#none.

refs: Kotlin/kotlinx.coroutines#4212

  def none[T](p: T => Boolean): Sink[T, Future[Boolean]] =
    Flow[T].foldWhile(true)(util.ConstantFun.scalaIdentityFunction)(_ && !p(_))
      .toMat(Sink.head)(Keep.right)
      .named("noneSink")
@He-Pin He-Pin added the t:stream Pekko Streams label Dec 19, 2024
@He-Pin He-Pin modified the milestones: 1.1.3, 1.1.x Dec 19, 2024
@beyondyuefei
Copy link

cool~

@He-Pin He-Pin closed this as completed Dec 28, 2024
@He-Pin He-Pin modified the milestones: 1.1.3, 1.2.0 Dec 28, 2024
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

No branches or pull requests

2 participants