-
Notifications
You must be signed in to change notification settings - Fork 171
feat: Add dropRepeated stream operator. #1868
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
Conversation
4793dc5
to
b129c0d
Compare
@pjfanning Would you like to give another round of review on this? I want to add |
Is there a reason not to just call this |
I think we should try and avoid confusion with https://www.scala-lang.org/api/3.7.0/scala/collection/SeqOps.html#distinct-0 I understand the name follows https://rxjs.dev/api/operators/distinctUntilChanged . I'm not sure it makes sense to me: the results aren't 'distinct' 'until' they are the same? I don't want to bikeshed too much, but something like `dropRepeated' might make more sense? We can mention in the docs that this is called distinctUntilChanged in rx so people can find it. The docs for 'statefulMap' have this as an example (https://pekko.apache.org/docs/pekko/current/stream/operators/Source-or-Flow/statefulMap.html). There's something to be said for having it as a separate construct, but perhaps the docs should link to each other? |
stream-tests/src/test/java/org/apache/pekko/stream/javadsl/SourceTest.java
Outdated
Show resolved
Hide resolved
@pjfanning I'm following the naming in reactor-core and smallrye/smallrye-mutiny#1853, rxjava is using this name too. The main reason to add more operator is because when reading the code of Spring-Ai, and I found these operators are quite common, I hope someone will choose pekko to build scala's Spring-Ai And we are building our mcp server at work too:) |
I suppose that this function is not then the same as |
@pjfanning @pjfanning And in Kotlin flow, it's and Which name do you prefer, actually, I don't like the |
I could live with |
@pjfanning @raboof I have update to |
docs/src/main/paradox/stream/operators/Source-or-Flow/dropRepeated.md
Outdated
Show resolved
Hide resolved
stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowDropRepeatedSpec.scala
Outdated
Show resolved
Hide resolved
stream/src/main/scala/org/apache/pekko/stream/impl/fusing/DropRepeated.scala
Outdated
Show resolved
Hide resolved
@pjfanning Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Motivation:
Add dropRepeated stream operator.
refs: #1662