He-Pin opened a new pull request, #2824:
URL: https://github.com/apache/pekko/pull/2824
## Motivation
Add the `gather` operator across the Scala and Java DSLs, tighten its
execution semantics, and broaden its statefulMap-equivalent regression coverage.
This PR also includes the hot-path and backpressure fixes found during
review, plus benchmark and documentation support for the new operator.
## Modification
- add `gather` API support in the Scala and Java DSLs
- implement the `Gather` stage and supporting `Gatherer` / `GatherCollector`
APIs
- add Scala, Java, and docs examples for the operator
- add `FlowGatherSpec` plus Java parity coverage
- add JMH coverage for `zipWithIndex`-style workloads
- optimize the public single-output gather hot path
- fix the `OneToOneGatherer` backpressure issue found during review
- expand tests toward statefulMap-equivalent scenarios such as happy-path
state retention, restart, stop, and backpressure
## Result
- `gather` is documented and available end-to-end in Scala and Java DSLs
- correctness coverage is materially stronger, especially around supervision
and backpressure
- local verification passed:
- `sbt --no-colors 'scalafmtAll' 'stream-tests/testOnly
org.apache.pekko.stream.scaladsl.FlowGatherSpec' 'stream-tests/testOnly
org.apache.pekko.stream.javadsl.FlowTest' 'stream-tests/testOnly
org.apache.pekko.stream.javadsl.SourceTest' 'docs/test:compile'
'bench-jmh/Jmh/compile'`
- corrected local JMH indicates `gather`-based `zipWithIndex` is now near
parity with `statefulMap`
## References
- `stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala`
-
`stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowGatherSpec.scala`
- `stream/src/main/scala/org/apache/pekko/stream/scaladsl/Gather.scala`
- `stream/src/main/scala/org/apache/pekko/stream/javadsl/Gather.scala`
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]