-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Removed unnecessary upstream.cancel() call for casually finished upstream sequences. #6992
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
Removed unnecessary upstream.cancel() call for casually finished upstream sequences. #6992
Conversation
sobersanta
commented
May 20, 2020
•
edited
Loading
edited
- no upstream.cancel() in FlowablePublishMulticast when the sequence is finished normally via onComplete/onError from upstream;
- minor code cleanup - unnecessary Disposable implementation to avoid method name clash
- Fixes 3.x: unnecessary call to upstream .cancel() in FlowablePublishMulticast operator #6989
- FlowablePublishFunctionTest.java refactored to use lambdas
… finished normally via onComplete/onError from upstream; minor code cleanup - unnecessary Disposable implementation to avoid method name clash
public void noUpstreamCancelOnCasualChainClose() { | ||
AtomicBoolean parentUpstreamCancelled = new AtomicBoolean(false); | ||
Flowable.range(1, 10) | ||
.doOnCancel(new Action() { |
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.
You can use lambdas in tests now.
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.
Cool!
Should I change it?
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.
Yes.
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 that's fine, I've refactored whole file to lambdas.
Codecov Report
@@ Coverage Diff @@
## 3.x #6992 +/- ##
============================================
+ Coverage 99.49% 99.52% +0.03%
- Complexity 6669 6670 +1
============================================
Files 742 742
Lines 47267 47268 +1
Branches 6374 6375 +1
============================================
+ Hits 47026 47044 +18
+ Misses 114 105 -9
+ Partials 127 119 -8 Continue to review full report at Codecov.
|