本文整理汇总了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;
});
}
示例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;
}
});
}
示例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);
}
示例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;
});
}