Java Code Examples for io.reactivex.Observable.blockingSubscribe()

The following are Jave code examples for showing how to use blockingSubscribe() of the io.reactivex.Observable class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: Learning-RxJava   File:   View Source Code Vote up 5 votes
public void testBlockingSubscribe() {
    AtomicInteger hitCount = new AtomicInteger();
    Observable<Long> source = Observable.interval(1,
    source.blockingSubscribe(i -> hitCount.incrementAndGet());
    assertTrue(hitCount.get() == 5);