You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "He-Pin (via GitHub)" <gi...@apache.org> on 2026/03/29 15:47:22 UTC
[PR] stream: add gather operator and tighten coverage [pekko]
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: 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] stream: add gather operator and tighten coverage [pekko]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin closed pull request #2824: stream: add gather operator and tighten coverage
URL: https://github.com/apache/pekko/pull/2824
--
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