-
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
2.x: Add Flowable.concatMap{Maybe,Single}{DelayError} operators #5872
Conversation
Codecov Report
@@ Coverage Diff @@
## 2.x #5872 +/- ##
============================================
+ Coverage 96.54% 96.57% +0.03%
- Complexity 5862 5885 +23
============================================
Files 647 650 +3
Lines 42766 43156 +390
Branches 5933 5994 +61
============================================
+ Hits 41289 41679 +390
- Misses 568 572 +4
+ Partials 909 905 -4
Continue to review full report at Codecov.
|
@@ -7313,6 +7313,362 @@ public final Completable concatMapCompletableDelayError(Function<? super T, ? ex | |||
return RxJavaPlugins.onAssembly(new FlowableFlattenIterable<T, U>(this, mapper, prefetch)); | |||
} | |||
|
|||
/** | |||
* Maps the upstream intems into {@link MaybeSource}s and subscribes to them one after the |
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.
intems
-> items
} | ||
|
||
/** | ||
* Maps the upstream intems into {@link MaybeSource}s and subscribes to them one after the |
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.
same
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.
Still reading the code, but here are few small things in javadoc
* <dt><b>Backpressure:</b></dt> | ||
* <dd>The operator expects the upstream to support backpressure and honors | ||
* the backpressure from downstream. If this {@code Flowable} violates the rule, the operator will | ||
* signal a {@code MissingBackpressureException}.</dd> |
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.
[signal]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.
Same in all javadocs below
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.
Sounds fine with me:
"the operator will signal a MissingBackpressureException."
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.
wow, sure, my bad, sorry
|
||
/** | ||
* Maps the upstream items into {@link SingleSource}s and subscribes to them one after the | ||
* other succeeds or completes, emits their success value if available or terminates immediately if |
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.
remove "completes"? It's a Single :)
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.
Same below
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.
👍
* @since 2.1.11 - experimental | ||
*/ | ||
@Experimental | ||
public final class FlowableConcatMapMaybe<T, R> extends Flowable<R> { |
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 urgently need a CallMe
operator so we could have FlowableCallMeMaybe
😸
import io.reactivex.subjects.MaybeSubject; | ||
import io.reactivex.subscribers.TestSubscriber; | ||
|
||
public class FlowableConcatMapMaybeTest { |
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.
very nice tests
This PR adds operators that allow concatenating a mapped sequence of
Maybe
s orSingle
s, with or without delaying their errors:concatMapMaybe
(+1 overload with prefetch)concatMapMaybeDelayError
(+2 overloads with error mode and prefetch)concatMapSingle
(+1 overload with prefetch)concatMapSingleDelayError
(+2 overloads with error mode and prefetch)They are in the same PR as the
Single
variant's implementation is practically theMaybe
implementation minus theonComplete
case.Their marbles will be updated in a separate PR.
Originally requested in #4853.