Add alsoTo/alsoToContext to FlowWithContext/SourceWithContext#1443
Merged
mdedetrich merged 1 commit intoapache:mainfrom Aug 23, 2024
Merged
Conversation
1e091bb to
facf742
Compare
Contributor
Author
|
PR is now ready to review, the link-validator failure is not related |
Member
|
I would like a couple of trivial test cases - even if for regression purposes. Also useful as a way of documenting the usage. |
6ed64a7 to
ad0c4e5
Compare
pjfanning
reviewed
Aug 23, 2024
stream/src/main/scala/org/apache/pekko/stream/scaladsl/FlowWithContextOps.scala
Show resolved
Hide resolved
ad0c4e5 to
70d929b
Compare
Contributor
Author
|
Thanks for the review, everything is passing and I have added the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds
alsoTo/alsoToContextontoFlowWithContext/SourceWithContextwhich just wrap the underlyingdelegatemethods, this is analogous to the currentmap/mapContextmethods that already exist.Note that
delegate.alsoTo(Flow.fromFunction { in: (Out, Ctx) => in._2 }.toMat(that)(Keep.right))is copied from the implementation ofcontramap. I would have ideally liked to usecontramaphowever the method is not available on aGraph[SinkShape[_]]I didn't add tests due to the sheer triviality of the implementation but can add them if asked.