io.reactivex.Flowable.blockingSubscribe()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(223)

本文整理了Java中io.reactivex.Flowable.blockingSubscribe()方法的一些代码示例,展示了Flowable.blockingSubscribe()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Flowable.blockingSubscribe()方法的具体详情如下:
包路径:io.reactivex.Flowable
类名称:Flowable
方法名:blockingSubscribe

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();
}

相关文章

Flowable类方法