当前位置: 首页>>代码示例>>Java>>正文


Java RxJavaHooks.setOnObservableSubscribeError方法代码示例

本文整理汇总了Java中rx.plugins.RxJavaHooks.setOnObservableSubscribeError方法的典型用法代码示例。如果您正苦于以下问题:Java RxJavaHooks.setOnObservableSubscribeError方法的具体用法?Java RxJavaHooks.setOnObservableSubscribeError怎么用?Java RxJavaHooks.setOnObservableSubscribeError使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在rx.plugins.RxJavaHooks的用法示例。


在下文中一共展示了RxJavaHooks.setOnObservableSubscribeError方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setupHooks

import rx.plugins.RxJavaHooks; //导入方法依赖的package包/类
private void setupHooks() {
    RxJavaHooks.setOnObservableStart((observable, onSubscribe) -> {
        incrementActiveSubscriptionsCount();
        return onSubscribe;
    });

    RxJavaHooks.setOnObservableSubscribeError(throwable -> {
        decrementActiveSubscriptionsCount();
        return throwable;
    });

    RxJavaHooks.setOnObservableReturn(subscription -> {
        decrementActiveSubscriptionsCount();
        return subscription;
    });
}
 
开发者ID:OHoussein,项目名称:Android-Show-Reader,代码行数:17,代码来源:RxIdlingResource.java

示例2: setupHooks

import rx.plugins.RxJavaHooks; //导入方法依赖的package包/类
private void setupHooks() {
    RxJavaHooks.setOnObservableStart(new Func2<Observable, OnSubscribe, OnSubscribe>() {
        @Override
        public OnSubscribe call(Observable observable, OnSubscribe onSubscribe) {
            incrementActiveSubscriptionsCount();
            return onSubscribe;
        }
    });

    RxJavaHooks.setOnObservableSubscribeError(new Func1<Throwable, Throwable>() {
        @Override
        public Throwable call(Throwable throwable) {
            decrementActiveSubscriptionsCount();
            return throwable;
        }
    });

    RxJavaHooks.setOnObservableReturn(new Func1<Subscription, Subscription>() {
        @Override
        public Subscription call(Subscription subscription) {
            decrementActiveSubscriptionsCount();
            return subscription;
        }
    });
}
 
开发者ID:ebridfighter,项目名称:GongXianSheng,代码行数:26,代码来源:RxIdlingResource.java

示例3: registerRxJavaIdlingResources

import rx.plugins.RxJavaHooks; //导入方法依赖的package包/类
private void registerRxJavaIdlingResources() {
    RxIdlingResource rxIdlingResource = new RxIdlingResource();

    RxJavaHooks.setOnObservableStart((observable, onSubscribe) -> {
        rxIdlingResource.incrementActiveSubscriptionsCount();
        return onSubscribe;
    });

    RxJavaHooks.setOnObservableReturn(subscription -> {
        rxIdlingResource.decrementActiveSubscriptionsCount();
        return subscription;
    });

    RxJavaHooks.setOnObservableSubscribeError(throwable -> {
        rxIdlingResource.decrementActiveSubscriptionsCount();
        return throwable;
    });

    Espresso.registerIdlingResources(rxIdlingResource);
}
 
开发者ID:BartoszJarocki,项目名称:android-starter,代码行数:21,代码来源:StarterTestRunner.java

示例4: setHook

import rx.plugins.RxJavaHooks; //导入方法依赖的package包/类
public void setHook() {
    RxJavaHooks.reset();
    RxJavaHooks.setOnObservableStart((observable, onSubscribe) -> {
        mRxIdlingResource.incrementActiveSubscriptionsCount();
        return onSubscribe;
    });
    RxJavaHooks.setOnObservableSubscribeError(throwable -> {
        mRxIdlingResource.decrementActiveSubscriptionsCount();
        return throwable;
    });
    RxJavaHooks.setOnObservableReturn(subscription -> {
        mRxIdlingResource.decrementActiveSubscriptionsCount();
        return subscription;
    });
}
 
开发者ID:AnironGlass,项目名称:MVP-Boilerplate,代码行数:16,代码来源:RxIdlingExecutionHook.java


注:本文中的rx.plugins.RxJavaHooks.setOnObservableSubscribeError方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。