Copilot commented on code in PR #1820: URL: https://github.com/apache/pekko/pull/1820#discussion_r2051476607
########## docs/src/main/paradox/stream/operators/index.md: ########## @@ -191,6 +191,7 @@ depending on being backpressured by downstream or not. |Source/Flow|<a name="statefulmap"></a>@ref[statefulMap](Source-or-Flow/statefulMap.md)|Transform each stream element with the help of a state.| |Source/Flow|<a name="statefulmapconcat"></a>@ref[statefulMapConcat](Source-or-Flow/statefulMapConcat.md)|Transform each element into zero or more elements that are individually passed downstream.| |Source/Flow|<a name="take"></a>@ref[take](Source-or-Flow/take.md)|Pass `n` incoming elements downstream and then complete| +|Source/Flow|<a name="takeuntil"></a>@ref[takeUntil](Source-or-Flow/takeUntil.md)|Pass elements downstream as long as a predicate function returns true and then complete.| |Source/Flow|<a name="takewhile"></a>@ref[takeWhile](Source-or-Flow/takeWhile.md)|Pass elements downstream as long as a predicate function returns true and then complete. | Review Comment: The description for the takeUntil operator in the index file does not match the detailed documentation. Consider revising it to clarify that elements are passed as long as the predicate returns false (including the triggering element) before completing. ```suggestion |Source/Flow|<a name="takeuntil"></a>@ref[takeUntil](Source-or-Flow/takeUntil.md)|Pass elements downstream as long as a predicate function returns false, including the first element for which the predicate returns true, and then complete.| ``` ########## docs/src/main/paradox/stream/operators/Source-or-Flow/takeUntil.md: ########## @@ -0,0 +1,29 @@ +# takeUntil + +Pass elements downstream as long as a predicate function returns true and then complete. + +@ref[Simple operators](../index.md#simple-operators) + +## Signature + +@apidoc[Source.takeUntil](Source) { scala="#takeUntil(p:Out=>Boolean):FlowOps.this.Repr[Out]" java="#takeUntil( +org.apache.pekko.japi.function.Predicate)" } +@apidoc[Flow.takeUntil](Flow) { scala="#takeUntil(p:Out=>Boolean):FlowOps.this.Repr[Out]" java="#takeUntil( +org.apache.pekko.japi.function.Predicate)" } + +## Description + +Pass elements downstream as long as a predicate function returns false or after the predicate function first returns +true and then complete. The first element for which the predicate returns true is also emitted. + Review Comment: [nitpick] The description is somewhat confusing. Consider rephrasing it to clearly state that elements are passed until the predicate returns true and that the first element matching the predicate is also emitted before completion. ```suggestion Pass elements downstream until the predicate function returns true. The first element for which the predicate returns true is also emitted before the stream completes. ``` -- 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-unsubscr...@pekko.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@pekko.apache.org For additional commands, e-mail: notifications-h...@pekko.apache.org