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: Rename BackpressureStrategy.NONE to MISSING #4767

Merged
merged 1 commit into from
Oct 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/io/reactivex/BackpressureStrategy.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public enum BackpressureStrategy {
* Downstream has to deal with any overflow.
* <p>Useful when one applies one of the custom-parameter onBackpressureXXX operators.
*/
NONE,
MISSING,
/**
* Signals a MissingBackpressureException in case the downstream can't keep up.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/reactivex/Observable.java
Original file line number Diff line number Diff line change
Expand Up @@ -11758,7 +11758,7 @@ public final Flowable<T> toFlowable(BackpressureStrategy strategy) {
return o.onBackpressureDrop();
case LATEST:
return o.onBackpressureLatest();
case NONE:
case MISSING:
return o;
case ERROR:
return RxJavaPlugins.onAssembly(new FlowableOnBackpressureError<T>(o));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public void subscribeActual(Subscriber<? super T> t) {
BaseEmitter<T> emitter;

switch (backpressure) {
case NONE: {
emitter = new NoneEmitter<T>(t);
case MISSING: {
emitter = new MissingEmitter<T>(t);
break;
}
case ERROR: {
Expand Down Expand Up @@ -319,12 +319,12 @@ public final FlowableEmitter<T> serialize() {
}
}

static final class NoneEmitter<T> extends BaseEmitter<T> {
static final class MissingEmitter<T> extends BaseEmitter<T> {


private static final long serialVersionUID = 3776720187248809713L;

NoneEmitter(Subscriber<? super T> actual) {
MissingEmitter(Subscriber<? super T> actual) {
super(actual);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ public void subscribe(FlowableEmitter<Integer> e) throws Exception {
}

@Test
public void createNullValueNone() {
public void createNullValueMissing() {
final Throwable[] error = { null };

Flowable.create(new FlowableOnSubscribe<Integer>() {
Expand All @@ -329,7 +329,7 @@ public void subscribe(FlowableEmitter<Integer> e) throws Exception {
error[0] = ex;
}
}
}, BackpressureStrategy.NONE)
}, BackpressureStrategy.MISSING)
.test()
.assertFailure(NullPointerException.class);

Expand Down Expand Up @@ -433,7 +433,7 @@ public void subscribe(FlowableEmitter<Integer> e) throws Exception {
}

@Test
public void createNullValueNoneSerialized() {
public void createNullValueMissingSerialized() {
final Throwable[] error = { null };

Flowable.create(new FlowableOnSubscribe<Integer>() {
Expand All @@ -449,7 +449,7 @@ public void subscribe(FlowableEmitter<Integer> e) throws Exception {
error[0] = ex;
}
}
}, BackpressureStrategy.NONE)
}, BackpressureStrategy.MISSING)
.test()
.assertFailure(NullPointerException.class);

Expand Down Expand Up @@ -653,7 +653,7 @@ public void subscribe(FlowableEmitter<Integer> e) throws Exception {

@Test(expected = NullPointerException.class)
public void nullArgument() {
Flowable.create(null, BackpressureStrategy.NONE);
Flowable.create(null, BackpressureStrategy.MISSING);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
public class FlowableFromObservableTest {
@Test
public void dispose() {
TestHelper.checkDisposed(Observable.just(1).toFlowable(BackpressureStrategy.NONE));
TestHelper.checkDisposed(Observable.just(1).toFlowable(BackpressureStrategy.MISSING));
}

@Test
public void error() {
Observable.error(new TestException())
.toFlowable(BackpressureStrategy.NONE)
.toFlowable(BackpressureStrategy.MISSING)
.test()
.assertFailure(TestException.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ public void normalLatest() {
}

@Test
public void normalNone() {
Flowable.create(source, BackpressureStrategy.NONE).subscribe(ts);
public void normalMissing() {
Flowable.create(source, BackpressureStrategy.MISSING).subscribe(ts);

source.onNext(1);
source.onNext(2);
Expand All @@ -109,8 +109,8 @@ public void normalNone() {
}

@Test
public void normalNoneRequested() {
Flowable.create(source, BackpressureStrategy.NONE).subscribe(ts);
public void normalMissingRequested() {
Flowable.create(source, BackpressureStrategy.MISSING).subscribe(ts);
ts.request(2);

source.onNext(1);
Expand Down Expand Up @@ -175,8 +175,8 @@ public void errorLatest() {
}

@Test
public void errorNone() {
Flowable.create(source, BackpressureStrategy.NONE).subscribe(ts);
public void errorMissing() {
Flowable.create(source, BackpressureStrategy.MISSING).subscribe(ts);

source.onNext(1);
source.onNext(2);
Expand Down Expand Up @@ -254,8 +254,8 @@ public void unsubscribedDrop() {
}

@Test
public void unsubscribedNone() {
Flowable.create(source, BackpressureStrategy.NONE).subscribe(ts);
public void unsubscribedMissing() {
Flowable.create(source, BackpressureStrategy.MISSING).subscribe(ts);
ts.cancel();

source.onNext(1);
Expand Down Expand Up @@ -334,8 +334,8 @@ public void unsubscribedNoCancelDrop() {
}

@Test
public void unsubscribedNoCancelNone() {
Flowable.create(sourceNoCancel, BackpressureStrategy.NONE).subscribe(ts);
public void unsubscribedNoCancelMissing() {
Flowable.create(sourceNoCancel, BackpressureStrategy.MISSING).subscribe(ts);
ts.cancel();

sourceNoCancel.onNext(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ public void subscribe(FlowableEmitter<Object> s) throws Exception {
s.onNext(i);
}
}
}, BackpressureStrategy.NONE)
}, BackpressureStrategy.MISSING)
.publish(8)
.autoConnect()
.test(0L)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void toFlowableError2() {
@Test
public void toFlowableMissing() {
TestSubscriber<Integer> ts = Observable.range(1, 5)
.toFlowable(BackpressureStrategy.NONE)
.toFlowable(BackpressureStrategy.MISSING)
.test(0);

ts.request(2);
Expand Down