本文整理了Java中io.reactivex.Flowable.blockingSubscribe()
方法的一些代码示例,展示了Flowable.blockingSubscribe()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Flowable.blockingSubscribe()
方法的具体详情如下:
包路径:io.reactivex.Flowable
类名称:Flowable
方法名:blockingSubscribe
[英]Runs the source Flowable to a terminal event, ignoring any values and rethrowing any exception. Backpressure: The operator consumes the source Flowable in an unbounded manner (i.e., no backpressure applied to it). Scheduler: blockingSubscribe does not operate by default on a particular Scheduler.
[中]运行可流向终端事件的源,忽略任何值并重新引发任何异常。背压:操作员以无限制的方式消耗可流动源(即,不施加背压)。调度程序:blockingSubscribe默认情况下不会在特定调度程序上运行。
代码示例来源:origin: ReactiveX/RxJava
public void groupByKeyNull() {
just1.groupBy(new Function<Integer, Object>() {
@Override
public Object apply(Integer v) {
return null;
}
}).blockingSubscribe();
}
代码示例来源:origin: ReactiveX/RxJava
@Test(expected = NullPointerException.class)
public void concatIterableIteratorNull() {
Single.concat(new Iterable<Single<Object>>() {
@Override
public Iterator<Single<Object>> iterator() {
return null;
}
}).blockingSubscribe();
}
代码示例来源:origin: ReactiveX/RxJava
@Test(expected = NullPointerException.class)
public void debounceFunctionReturnsNull() {
just1.debounce(new Function<Integer, Publisher<Object>>() {
@Override
public Publisher<Object> apply(Integer v) {
return null;
}
}).blockingSubscribe();
}
代码示例来源:origin: ReactiveX/RxJava
@Test(expected = NullPointerException.class)
public void distinctFunctionReturnsNull() {
just1.distinct(new Function<Integer, Object>() {
@Override
public Object apply(Integer v) {
return null;
}
}).blockingSubscribe();
}
代码示例来源:origin: ReactiveX/RxJava
@Test(expected = NullPointerException.class)
public void startWithIterableIteratorNull() {
just1.startWith(new Iterable<Integer>() {
@Override
public Iterator<Integer> iterator() {
return null;
}
}).blockingSubscribe();
}
代码示例来源:origin: ReactiveX/RxJava
@Test(expected = NullPointerException.class)
public void windowBoundarySupplierReturnsNull() {
just1.window(new Callable<Publisher<Object>>() {
@Override
public Publisher<Object> call() {
return null;
}
}).blockingSubscribe();
}
代码示例来源:origin: ReactiveX/RxJava
@Test(expected = NullPointerException.class)
public void bufferSupplierReturnsNull() {
just1.buffer(1, 1, new Callable<Collection<Integer>>() {
@Override
public Collection<Integer> call() {
return null;
}
}).blockingSubscribe();
}
代码示例来源:origin: ReactiveX/RxJava
@Test(expected = NullPointerException.class)
public void bufferBoundarySupplier2ReturnsNull() {
just1.buffer(new Callable<Publisher<Object>>() {
@Override
public Publisher<Object> call() {
return null;
}
}).blockingSubscribe();
}
代码示例来源:origin: ReactiveX/RxJava
@Test(expected = NullPointerException.class)
public void concatMapReturnsNull() {
just1.concatMap(new Function<Integer, Publisher<Object>>() {
@Override
public Publisher<Object> apply(Integer v) {
return null;
}
}).blockingSubscribe();
}
代码示例来源:origin: ReactiveX/RxJava
@Test(expected = NullPointerException.class)
public void flatMapIterableMapperIterableOneNull() {
just1.flatMapIterable(new Function<Integer, Iterable<Integer>>() {
@Override
public Iterable<Integer> apply(Integer v) {
return Arrays.asList(1, null);
}
}).blockingSubscribe();
}
代码示例来源:origin: ReactiveX/RxJava
@Test(expected = NullPointerException.class)
public void liftReturnsNull() {
just1.lift(new FlowableOperator<Object, Integer>() {
@Override
public Subscriber<? super Integer> apply(Subscriber<? super Object> s) {
return null;
}
}).blockingSubscribe();
}
代码示例来源:origin: ReactiveX/RxJava
@Test(expected = NullPointerException.class)
public void replayBoundedUnitNull() {
just1.replay(new Function<Flowable<Integer>, Publisher<Integer>>() {
@Override
public Publisher<Integer> apply(Flowable<Integer> v) {
return v;
}
}, 1, 1, null).blockingSubscribe();
}
代码示例来源:origin: ReactiveX/RxJava
@Test(expected = NullPointerException.class)
public void timeoutSelectorReturnsNull() {
just1.timeout(new Function<Integer, Publisher<Object>>() {
@Override
public Publisher<Object> apply(Integer v) {
return null;
}
}).blockingSubscribe();
}
代码示例来源:origin: ReactiveX/RxJava
@Test(expected = NullPointerException.class)
public void zipWithCombinerReturnsNull() {
just1.zipWith(just1, new BiFunction<Integer, Integer, Object>() {
@Override
public Object apply(Integer a, Integer b) {
return null;
}
}).blockingSubscribe();
}
代码示例来源:origin: ReactiveX/RxJava
@Override
public Integer apply(Integer v) throws Exception {
Flowable.just(1).delay(10, TimeUnit.SECONDS).blockingSubscribe();
return v;
}
})
代码示例来源:origin: ReactiveX/RxJava
@Test(expected = NullPointerException.class)
public void timeoutFirstItemReturnsNull() {
just1.timeout(Flowable.never(), new Function<Integer, Publisher<Object>>() {
@Override
public Publisher<Object> apply(Integer v) {
return null;
}
}).blockingSubscribe();
}
代码示例来源:origin: ReactiveX/RxJava
@Test
public void flowableBoundedBlockingSubscribe1() {
Flowable.error(new TestException())
.blockingSubscribe(Functions.emptyConsumer(), 128);
}
代码示例来源:origin: ReactiveX/RxJava
@Test
public void flowableBlockingSubscribe1() {
Flowable.error(new TestException())
.blockingSubscribe(Functions.emptyConsumer());
}
代码示例来源:origin: ReactiveX/RxJava
@Test(expected = NullPointerException.class)
public void retryWhenFunctionReturnsNull() {
Flowable.error(new TestException()).retryWhen(new Function<Flowable<? extends Throwable>, Publisher<Object>>() {
@Override
public Publisher<Object> apply(Flowable<? extends Throwable> f) {
return null;
}
}).blockingSubscribe();
}
代码示例来源:origin: ReactiveX/RxJava
@Test
public void disposeUpFront() {
TestSubscriber<Object> ts = new TestSubscriber<Object>();
ts.dispose();
Flowable.just(1).blockingSubscribe(ts);
ts.assertEmpty();
}
内容来源于网络,如有侵权,请联系作者删除!