io.reactivex.Observable.never()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(3.9k)|赞(0)|评价(0)|浏览(254)

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

Observable.never介绍

[英]Returns an Observable that never sends any items or notifications to an Observer.

This ObservableSource is useful primarily for testing purposes. Scheduler: never does not operate by default on a particular Scheduler.
[中]

代码示例

代码示例来源:origin: ReactiveX/RxJava

@Override
  public ObservableSource<Object> apply(Integer left) throws Exception {
    return Observable.never();
  }
},

代码示例来源:origin: ReactiveX/RxJava

@Override
  public ObservableSource<Object> apply(Object left) throws Exception {
    return Observable.never();
  }
},

代码示例来源:origin: ReactiveX/RxJava

@Override
  public ObservableSource<Object> apply(Object left) throws Exception {
    return Observable.never();
  }
},

代码示例来源:origin: ReactiveX/RxJava

@Override
  public Observable<Object> call() {
    return Observable.never();
  }
}).subscribe(to);

代码示例来源:origin: ReactiveX/RxJava

@Override
  public ObservableSource<Integer> apply(Integer v) throws Exception {
    if (v == 1) {
      return ps2;
    }
    return Observable.never();
  }
})

代码示例来源:origin: ReactiveX/RxJava

@Override
  public ObservableSource<Object> apply(Integer o) throws Exception {
    to.cancel();
    return Observable.never();
  }
})

代码示例来源:origin: ReactiveX/RxJava

@Override
  public ObservableSource<Object> apply(Observable<Object> o) throws Exception {
    return o.skipUntil(Observable.never());
  }
});

代码示例来源:origin: ReactiveX/RxJava

@Override
  public ObservableSource<List<Object>> apply(Observable<Object> f)
      throws Exception {
    return f.buffer(Observable.never());
  }
}

代码示例来源:origin: ReactiveX/RxJava

@SuppressWarnings("unchecked")
@Test
public void singleElementArray() {
  assertSame(Observable.never(), Observable.concatArrayDelayError(Observable.never()));
}

代码示例来源:origin: ReactiveX/RxJava

@SuppressWarnings("unchecked")
@Test
public void concatArraySingleElement() {
  assertSame(Observable.never(), Observable.concatArray(Observable.never()));
}

代码示例来源:origin: ReactiveX/RxJava

@Override
  public Observable<Observable<Object>> apply(Observable<Object> f)
      throws Exception {
    return f.window(Observable.never()).takeLast(1);
  }
});

代码示例来源:origin: ReactiveX/RxJava

@Test
public void interrupt() {
  TestObserver<Object> to = new TestObserver<Object>();
  Thread.currentThread().interrupt();
  Observable.never().blockingSubscribe(to);
}

代码示例来源:origin: ReactiveX/RxJava

@SuppressWarnings("unchecked")
@Test(expected = NullPointerException.class)
public void combineLatestVarargsFunctionNull() {
  Observable.combineLatest(null, 128, Observable.never());
}

代码示例来源:origin: ReactiveX/RxJava

@Test
public void manySources() {
  Observable<?>[] a = new Observable[32];
  Arrays.fill(a, Observable.never());
  a[31] = Observable.just(1);
  Observable.amb(Arrays.asList(a))
  .test()
  .assertResult(1);
}

代码示例来源:origin: ReactiveX/RxJava

@Test
public void disposed() {
  TestHelper.checkDisposed(
      Observable.never()
      .throttleLatest(1, TimeUnit.MINUTES)
  );
}

代码示例来源:origin: ReactiveX/RxJava

@SuppressWarnings("unchecked")
@Test(expected = NullPointerException.class)
public void ambVarargsOneIsNull() {
  Observable.ambArray(Observable.never(), null).blockingLast();
}

代码示例来源:origin: ReactiveX/RxJava

@Test
  public void isDisposed() {
    TestHelper.checkDisposed(Single.never().flatMapObservable(Functions.justFunction(Observable.never())));
  }
}

代码示例来源:origin: ReactiveX/RxJava

@Test
public void otherError() {
  Observable.never()
  .mergeWith(Single.error(new TestException()))
  .test()
  .assertFailure(TestException.class);
}

代码示例来源:origin: ReactiveX/RxJava

@Test
public void fallbackErrors() {
  Observable.never()
  .timeout(1, TimeUnit.MILLISECONDS, Observable.error(new TestException()))
  .test()
  .awaitDone(5, TimeUnit.SECONDS)
  .assertFailure(TestException.class);
}

代码示例来源:origin: ReactiveX/RxJava

@Test
public void dispose() {
  TestHelper.checkDisposed(PublishSubject.create().sample(1, TimeUnit.SECONDS, new TestScheduler()));
  TestHelper.checkDisposed(PublishSubject.create().sample(Observable.never()));
}

相关文章

Observable类方法