本文整理汇总了Java中rx.internal.operators.BlockingOperatorNext类的典型用法代码示例。如果您正苦于以下问题:Java BlockingOperatorNext类的具体用法?Java BlockingOperatorNext怎么用?Java BlockingOperatorNext使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BlockingOperatorNext类属于rx.internal.operators包,在下文中一共展示了BlockingOperatorNext类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testSingleSourceManyIterators
import rx.internal.operators.BlockingOperatorNext; //导入依赖的package包/类
@Test /* (timeout = 8000) */
public void testSingleSourceManyIterators() throws InterruptedException {
Observable<Long> o = Observable.interval(100, TimeUnit.MILLISECONDS);
PublishSubject<Void> terminal = PublishSubject.create();
BlockingObservable<Long> source = o.takeUntil(terminal).toBlocking();
Iterable<Long> iter = source.next();
for (int j = 0; j < 3; j++) {
BlockingOperatorNext.NextIterator<Long> it = (BlockingOperatorNext.NextIterator<Long>)iter.iterator();
for (long i = 0; i < 10; i++) {
Assert.assertEquals(true, it.hasNext());
Assert.assertEquals(j + "th iteration next", Long.valueOf(i), it.next());
}
terminal.onNext(null);
}
}
示例2: next
import rx.internal.operators.BlockingOperatorNext; //导入依赖的package包/类
public Iterable<T> next() {
return BlockingOperatorNext.next(this.o);
}
示例3: next
import rx.internal.operators.BlockingOperatorNext; //导入依赖的package包/类
/**
* Returns an {@link Iterable} that blocks until this {@code BlockingObservable} emits another item, then
* returns that item.
* <p>
* <img width="640" height="490" src="https://github.com/Netflix/RxJava/wiki/images/rx-operators/B.next.png" alt="">
*
* @return an {@link Iterable} that blocks upon each iteration until this {@code BlockingObservable} emits
* a new item, whereupon the Iterable returns that item
* @see <a href="https://github.com/Netflix/RxJava/wiki/Blocking-Observable-Operators#next">RxJava Wiki: next()</a>
* @see <a href="http://msdn.microsoft.com/en-us/library/hh211897.aspx">MSDN: Observable.Next</a>
*/
public Iterable<T> next() {
return BlockingOperatorNext.next(o);
}