-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Adding eager concats to Single #5976
Conversation
public static <T> Flowable<T> concatEager(Iterable<? extends SingleSource<? extends T>> sources) { | ||
return Flowable.fromIterable(sources).concatMapEager(SingleInternalHelper.<T>toFlowable()); | ||
} | ||
|
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 is another overload you missed:
public static <T> Flowable<T> concatEager(Publisher<? extends SingleSource<? extends T>> sources)
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.
Oops - thanks for the review, will update shortly
First of all, there is no reason keep the welcome text in the description.
Since this operator relies on |
Codecov Report
@@ Coverage Diff @@
## 2.x #5976 +/- ##
============================================
- Coverage 98.27% 98.25% -0.03%
- Complexity 6019 6021 +2
============================================
Files 656 656
Lines 44037 44040 +3
Branches 6100 6100
============================================
- Hits 43278 43271 -7
- Misses 224 230 +6
- Partials 535 539 +4
Continue to review full report at Codecov.
|
@@ -344,6 +344,32 @@ | |||
return Flowable.fromArray(sources).concatMapEager(SingleInternalHelper.<T>toFlowable()); | |||
} | |||
|
|||
/** | |||
* Concatenates a Publisher sequence of Publishers eagerly into a single stream of values. |
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.
SingleSources
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.
Could you also fix the JavaDoc of the Maybe
version?
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.
good idea, will do
@@ -345,7 +345,7 @@ | |||
} | |||
|
|||
/** | |||
* Concatenates a Publisher sequence of Publishers eagerly into a single stream of values. | |||
* Concatenates a Publisher sequence of Single sources eagerly into a single stream of values. |
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.
SingleSource
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.
hm.. i can see this "Single sources" instead of SingleSources in a few other places within the Javadoc of the Single class - guess we should fix all?
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.
Sure. I think they are remnants from the time when there was no SingleSource
interface yet.
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.
oh i see - fixed in all places within the Single class.
@@ -412,7 +412,7 @@ | |||
} | |||
|
|||
/** | |||
* Concatenates a Publisher sequence of Publishers eagerly into a single stream of values. | |||
* Concatenates a Publisher sequence of Maybe sources eagerly into a single stream of values. |
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.
Please fix these too.
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.
3 of them found and fixed.
Great! Thanks for contributing. Once one of the regular reviewers gives an approval, I'll merge this. (It's midnight over here so that could happen 8-10 hours from now.) |
Adding concatEager operator for Singles covering:
concatEager(Publisher<? extends SingleSource<? extends T>> sources)
concatEager(Iterable<? extends SingleSource<? extends T>> sources)
concatArrayEager(SingleSource<? extends T>... sources)
Issue: Single.concatEager is not implemented #5974
Added tests for both methods, I wasn't sure if I should add tests covering just a single element in the vararg list and respectively an iterable with a single element.. any thoughts on this?