Search in sources :

Example 6 with ParallelFlowable

use of io.reactivex.rxjava3.parallel.ParallelFlowable in project RxJava by ReactiveX.

the class ParallelRunOnTest method missingBackpressure.

@Test
public void missingBackpressure() {
    new ParallelFlowable<Integer>() {

        @Override
        public int parallelism() {
            return 1;
        }

        @Override
        public void subscribe(Subscriber<? super Integer>[] subscribers) {
            subscribers[0].onSubscribe(new BooleanSubscription());
            subscribers[0].onNext(1);
            subscribers[0].onNext(2);
            subscribers[0].onNext(3);
        }
    }.runOn(ImmediateThinScheduler.INSTANCE, 1).sequential(1).test(0).assertFailure(MissingBackpressureException.class);
}
Also used : BooleanSubscription(io.reactivex.rxjava3.internal.subscriptions.BooleanSubscription) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)6 BooleanSubscription (io.reactivex.rxjava3.internal.subscriptions.BooleanSubscription)4 TestSubscriber (io.reactivex.rxjava3.subscribers.TestSubscriber)2 RxMethod (io.reactivex.rxjava3.validators.BaseTypeParser.RxMethod)2 Subscriber (org.reactivestreams.Subscriber)2