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

Merge FlowableEmitter.BackpressureMode into BackpressureStrategy #4729

Merged
merged 2 commits into from
Oct 19, 2016
Merged

Merge FlowableEmitter.BackpressureMode into BackpressureStrategy #4729

merged 2 commits into from
Oct 19, 2016

Conversation

adipascu
Copy link

This is the implementation of #4727

@codecov-io
Copy link

codecov-io commented Oct 19, 2016

Current coverage is 89.91% (diff: 82.22%)

Merging #4729 into 2.x will decrease coverage by 0.02%

@@                2.x      #4729   diff @@
==========================================
  Files           571        571          
  Lines         37241      37276    +35   
  Methods           0          0          
  Messages          0          0          
  Branches       5671       5678     +7   
==========================================
+ Hits          33494      33518    +24   
- Misses         2253       2263    +10   
- Partials       1494       1495     +1   

Powered by Codecov. Last update f8b6fbd...05d21cb

@@ -9735,6 +9735,12 @@ public final Completable ignoreElements() {
return RxJavaPlugins.onAssembly(new FlowableOnBackpressureLatest<T>(this));
}

@BackpressureSupport(BackpressureKind.UNBOUNDED_IN)
Copy link
Member

Choose a reason for hiding this comment

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

This is the default behavior of most Flowable sources. Unnecessary.

@BackpressureSupport(BackpressureKind.UNBOUNDED_IN)
@SchedulerSupport(SchedulerSupport.NONE)
/*package*/ Flowable<T> onBackpressureError() {
return RxJavaPlugins.onAssembly(new FlowableOnBackpressureError<T>(this));
Copy link
Member

Choose a reason for hiding this comment

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

Should be inlined in Observable.toFlowable().

@@ -61,10 +61,13 @@ public void subscribeActual(Subscriber<? super T> t) {
emitter = new LatestAsyncEmitter<T>(t);
break;
}
default: {
case BUFFER: {
Copy link
Member

Choose a reason for hiding this comment

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

Why changing this?

TestSubscriber<Integer> ts = Observable.range(1, 5)
.toFlowable(BackpressureStrategy.ERROR)
.test(1)
.assertError(MissingBackpressureException.class);
Copy link
Member

Choose a reason for hiding this comment

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

Why not assertFailure(MissingBackpressureException.class, 1) to make sure 1 got through.

return o;
case ERROR:
return o.onBackpressureError();
case BUFFER:
Copy link
Member

Choose a reason for hiding this comment

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

Please leave these as default: because otherwise the default case can't be coverage-tested.

@akarnokd akarnokd added this to the 2.0 RC5 milestone Oct 19, 2016
@adipascu
Copy link
Author

adipascu commented Oct 19, 2016

I have implemented the changes from the code comments.
I'll keep in mind to rely on code coverage in the future.
Should I reply to the review comments directly ?

@akarnokd
Copy link
Member

No need in this case. Looks good to me.

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

Successfully merging this pull request may close these issues.

3 participants