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 onTerminateDetach to Single and Completable #5624

Merged
merged 2 commits into from
Sep 28, 2017

Conversation

akarnokd
Copy link
Member

@akarnokd akarnokd commented Sep 27, 2017

This PR adds the onTerminateDetach operator to Single and Completable. It was available on Flowable, Observable and Maybe already.

Plus:

  • Fixes the javadoc for Maybe.onTerminateDetach
  • Adds unit tests for verifying terminal events do release references with Maybe as well.

Their non-existence came up on StackOverflow.

Update

Turns out the downstream's actual references were not cleared in Maybe after all. Updated the PR to ensure that in all 3 of them and improved coverage.

@akarnokd akarnokd added this to the 2.2 milestone Sep 27, 2017
@codecov
Copy link

codecov bot commented Sep 27, 2017

Codecov Report

Merging #5624 into 2.x will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##                2.x    #5624      +/-   ##
============================================
+ Coverage     96.21%   96.24%   +0.03%     
- Complexity     5839     5853      +14     
============================================
  Files           632      634       +2     
  Lines         41476    41539      +63     
  Branches       5746     5752       +6     
============================================
+ Hits          39905    39980      +75     
+ Misses          624      616       -8     
+ Partials        947      943       -4
Impacted Files Coverage Δ Complexity Δ
src/main/java/io/reactivex/Maybe.java 100% <ø> (ø) 169 <0> (ø) ⬇️
src/main/java/io/reactivex/Completable.java 100% <100%> (ø) 113 <1> (+1) ⬆️
...ctivex/internal/operators/single/SingleDetach.java 100% <100%> (ø) 2 <2> (?)
...eactivex/internal/operators/maybe/MaybeDetach.java 100% <100%> (+9.67%) 2 <0> (ø) ⬇️
...ernal/operators/completable/CompletableDetach.java 100% <100%> (ø) 2 <2> (?)
src/main/java/io/reactivex/Single.java 100% <100%> (ø) 135 <1> (+1) ⬆️
...ernal/operators/flowable/FlowableFlatMapMaybe.java 92.27% <0%> (-4.35%) 2% <0%> (ø)
...nternal/operators/parallel/ParallelReduceFull.java 91.17% <0%> (-3.93%) 2% <0%> (ø)
...ternal/operators/observable/ObservablePublish.java 92.98% <0%> (-3.51%) 11% <0%> (ø)
.../io/reactivex/internal/schedulers/IoScheduler.java 89.24% <0%> (-3.23%) 9% <0%> (ø)
... and 31 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 8c5bd1d...f1c948c. Read the comment docs.

@akarnokd akarnokd merged commit ea4d43a into ReactiveX:2.x Sep 28, 2017
@akarnokd akarnokd deleted the DetachSingleNCompletable branch September 28, 2017 16:23
@artem-zinnatullin
Copy link
Contributor

// Wonder how many people use this api…

@akarnokd
Copy link
Member Author

After a LeakCanary report, more and more.

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.

3 participants