Skip to content
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 Observable switchMapX and concatMapX operators #5875

Merged
merged 2 commits into from
Mar 3, 2018

Conversation

akarnokd
Copy link
Member

@akarnokd akarnokd commented Mar 2, 2018

This PR ports the various switchMapX and concatMapX operators from #5870, #5871, #5872 and #5873 to Observable:

  • concatMapCompletable (replaced by the common implementation)
  • concatMapCompletableDelayError
  • concatMapMaybe
  • concatMapMaybeDelayError
  • concatMapSingle
  • concatMapSingleDelayError
  • switchMapCompletable
  • switchMapCompletableDelayError
  • switchMapMaybe
  • switchMapMaybeDelayError
  • switchMapSingle (dedicated implementation)
  • switchMapSingleDelayError (dedicated implementation)

This PR concludes the requested set of operators in #4853.

Marbles will be updated/adjusted in a separate PR.

@akarnokd akarnokd added this to the 2.2 milestone Mar 2, 2018
@codecov
Copy link

codecov bot commented Mar 2, 2018

Codecov Report

Merging #5875 into 2.x will increase coverage by 0.16%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##                2.x    #5875      +/-   ##
============================================
+ Coverage     96.59%   96.76%   +0.16%     
- Complexity     5893     5921      +28     
============================================
  Files           652      657       +5     
  Lines         43403    43986     +583     
  Branches       6033     6132      +99     
============================================
+ Hits          41926    42563     +637     
+ Misses          567      544      -23     
+ Partials        910      879      -31
Impacted Files Coverage Δ Complexity Δ
...operators/observable/ObservableInternalHelper.java 86.95% <ø> (-0.95%) 15 <0> (-3)
...rnal/operators/mixed/ObservableConcatMapMaybe.java 100% <100%> (ø) 2 <2> (?)
...nal/operators/mixed/ObservableSwitchMapSingle.java 100% <100%> (ø) 2 <2> (?)
...perators/mixed/ObservableSwitchMapCompletable.java 100% <100%> (ø) 2 <2> (?)
...ernal/operators/mixed/FlowableConcatMapSingle.java 100% <100%> (ø) 2 <0> (ø) ⬇️
...nal/operators/mixed/ObservableConcatMapSingle.java 100% <100%> (ø) 2 <2> (?)
...perators/mixed/ObservableConcatMapCompletable.java 100% <100%> (ø) 2 <2> (?)
src/main/java/io/reactivex/Observable.java 100% <100%> (ø) 535 <22> (+20) ⬆️
...ernal/operators/mixed/FlowableSwitchMapSingle.java 100% <100%> (ø) 2 <0> (ø) ⬇️
...rnal/operators/mixed/ObservableSwitchMapMaybe.java 100% <100%> (ø) 2 <2> (?)
... and 34 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d3ed269...e6168be. Read the comment docs.

Copy link
Collaborator

@vanniktech vanniktech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small nits. Maybe those renames could be done in a separate PR since this one is already super huge.

disposed = true;
inner.dispose();
t = errors.terminate();
if (t != ExceptionHelper.TERMINATED) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this path does not seem to be covered. same for 126. Is travis just flaky again?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a probabilistic race that the CI tends to not hit, no matter the race-loop count. It gets covered 80% of the time and unfortunately, I'd have to hack the state of the operator to get it execute that inner part a second time.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah thought so. Then never mind.

} else {
disposeInner();
Throwable ex = errors.terminate();
if (ex != ExceptionHelper.TERMINATED) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one too

current.dispose();
}

SingleSource<? extends R> ms;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be ss


@Test
public void boundaryError() {
PublishSubject<Integer> pp = PublishSubject.create();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ps

@akarnokd
Copy link
Member Author

akarnokd commented Mar 2, 2018

Reopening due to the Travis/GitHub service problems. The build succeeded but the PR doesn't seem to pick up that state.

@akarnokd akarnokd closed this Mar 2, 2018
@akarnokd akarnokd reopened this Mar 2, 2018
Copy link
Collaborator

@vanniktech vanniktech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it's all good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants