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.
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
Add flatMap method for collapsing streams into one #4227
Add flatMap method for collapsing streams into one #4227
Changes from 14 commits
d95055c
d3fba09
49fbc2e
761da4c
74bf0b7
80141c3
0082442
3219a78
589296b
8d0df8e
a9f6ab4
9a6d5fc
9bfcb8a
87ec0fb
dc7c776
400d092
84c4556
08cf0ff
2f5cb04
0155dcc
d1c4319
d2f053d
06f80eb
0ebe59a
28a1ea2
d7ac1c3
44f3920
ff2b023
6da1473
fc5948b
eff4ccc
8aed68f
5a2b058
a72d567
f3fa4a8
ca99d0c
a69185c
bc960cd
54a77e2
1cc7db7
80cebda
8b2b98e
eeb2085
e7b3d7f
b7ac1c4
3b35003
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Should we also abort the nested
StreamMessage
s in progress?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.
That sounds like a good idea. If I call
source.abort()
here, will that propagate to theSubscription
so that I can just cancel my nested subscriptions inonError
?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.
We should also call
completionFuture#completeExceptionally(cause)
in this blockStreamMessage#whenComplete
is an often used callback in this codebase, so it's important that this future is completedThere 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.
I guess whatever is in the
buffer
needs to be cleaned up/closed usingStreamMessageUtil.closeOrAbort
and alsowhenComplete
needs to be completed exceptionally.Same goes for when
FlatMapAggregatingSubscriber#cancel
is called.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.
Ditto: Cancel all inner
StreamMessage
s?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.
Are there any cases where
sourceSubscriptions.size()
is greater thanmaxConcurrency
?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.
It should never happen
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.
Let's add:
so that we don't request with
0
.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.
Shouldn't we call
flush
before request? so that we don't callupstream.request(...)
if we have enough elements to hand on to the downstream?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.
Should we cancel all
StreamMessage
s in progress?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.
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.
Will that handle overflowing in case
getRequested
returnsLong.MAX_VALUE
?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.
If
available
isLong.MAX_VALUE
, we don't need backpressure with buffering.