本文整理汇总了Java中rx.plugins.RxJavaHooks.setOnNewThreadScheduler方法的典型用法代码示例。如果您正苦于以下问题:Java RxJavaHooks.setOnNewThreadScheduler方法的具体用法?Java RxJavaHooks.setOnNewThreadScheduler怎么用?Java RxJavaHooks.setOnNewThreadScheduler使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rx.plugins.RxJavaHooks
的用法示例。
在下文中一共展示了RxJavaHooks.setOnNewThreadScheduler方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: apply
import rx.plugins.RxJavaHooks; //导入方法依赖的package包/类
@Override
public Statement apply(final Statement base, Description description) {
return new Statement() {
@Override
public void evaluate() throws Throwable {
RxAndroidPlugins.getInstance().reset();
RxAndroidPlugins.getInstance().registerSchedulersHook(mRxAndroidSchedulersHook);
RxJavaHooks.reset();
RxJavaHooks.setOnIOScheduler(mRxJavaImmediateScheduler);
RxJavaHooks.setOnNewThreadScheduler(mRxJavaImmediateScheduler);
base.evaluate();
RxAndroidPlugins.getInstance().reset();
RxJavaHooks.reset();
}
};
}
示例2: apply
import rx.plugins.RxJavaHooks; //导入方法依赖的package包/类
@Override
public Statement apply(final Statement base, Description description) {
return new Statement() {
@Override
public void evaluate() throws Throwable {
RxAndroidPlugins.getInstance().reset();
RxAndroidPlugins.getInstance().registerSchedulersHook(rxAndroidSchedulersHook);
RxJavaHooks.reset();
RxJavaHooks.setOnIOScheduler(rxJavaSchedulerHook);
RxJavaHooks.setOnNewThreadScheduler(rxJavaSchedulerHook);
RxJavaHooks.setOnComputationScheduler(rxJavaSchedulerHook);
base.evaluate();
RxAndroidPlugins.getInstance().reset();
RxJavaHooks.reset();
}
};
}
示例3: apply
import rx.plugins.RxJavaHooks; //导入方法依赖的package包/类
@Override
public Statement apply(final Statement base, Description description) {
return new Statement() {
@Override
public void evaluate() throws Throwable {
RxJavaHooks.reset();
RxJavaHooks.setOnIOScheduler(mMockSchedulerFunc);
RxJavaHooks.setOnNewThreadScheduler(mMockSchedulerFunc);
RxAndroidPlugins.getInstance().reset();
RxAndroidPlugins.getInstance().registerSchedulersHook(mRxAndroidSchedulersHook);
base.evaluate();
RxJavaHooks.reset();
RxAndroidPlugins.getInstance().reset();
}
};
}
示例4: apply
import rx.plugins.RxJavaHooks; //导入方法依赖的package包/类
@Override
public Statement apply(final Statement base, Description description) {
return new Statement() {
@Override
public void evaluate() throws Throwable {
RxJavaHooks.reset();
RxAndroidPlugins.getInstance().reset();
RxJavaHooks.setOnIOScheduler(scheduler -> Schedulers.immediate());
RxJavaHooks.setOnNewThreadScheduler(scheduler -> Schedulers.immediate());
RxJavaHooks.setOnComputationScheduler(scheduler -> Schedulers.immediate());
RxAndroidPlugins.getInstance().registerSchedulersHook(mRxAndroidSchedulersHook);
base.evaluate();
RxJavaHooks.reset();
RxAndroidPlugins.getInstance().reset();
}
};
}
示例5: setupTestSchedulers
import rx.plugins.RxJavaHooks; //导入方法依赖的package包/类
public static void setupTestSchedulers() {
try {
RxJavaHooks.setOnIOScheduler(scheduler -> Schedulers.immediate());
RxJavaHooks.setOnNewThreadScheduler(scheduler -> Schedulers.immediate());
RxAndroidPlugins.getInstance().registerSchedulersHook(new RxAndroidSchedulersHook() {
@Override
public Scheduler getMainThreadScheduler() {
return Schedulers.immediate();
}
});
} catch (IllegalStateException ignored) {
}
}
示例6: open
import rx.plugins.RxJavaHooks; //导入方法依赖的package包/类
public static void open() {
RxJavaHooks.setOnIOScheduler(scheduler -> Schedulers.immediate());
RxJavaHooks.setOnComputationScheduler(scheduler -> Schedulers.immediate());
RxJavaHooks.setOnNewThreadScheduler(scheduler -> Schedulers.immediate());
final RxAndroidPlugins rxAndroidPlugins = RxAndroidPlugins.getInstance();
rxAndroidPlugins.registerSchedulersHook(new RxAndroidSchedulersHook() {
@Override
public Scheduler getMainThreadScheduler() {
return Schedulers.immediate();
}
});
}
示例7: apply
import rx.plugins.RxJavaHooks; //导入方法依赖的package包/类
@Override
public Statement apply(Statement base, Description description) {
return new Statement() {
@Override
public void evaluate() throws Throwable {
RxJavaHooks.reset();
RxJavaHooks.setOnIOScheduler(scheduler -> Schedulers.immediate());
RxJavaHooks.setOnNewThreadScheduler(scheduler -> Schedulers.immediate());
RxJavaHooks.setOnComputationScheduler(scheduler -> Schedulers.immediate());
base.evaluate();
RxJavaHooks.reset();
}
};
}
示例8: setupTestSchedulers
import rx.plugins.RxJavaHooks; //导入方法依赖的package包/类
private void setupTestSchedulers() {
RxJavaHooks.setOnIOScheduler(scheduler -> Schedulers.immediate());
RxJavaHooks.setOnNewThreadScheduler(scheduler -> Schedulers.immediate());
try {
RxAndroidPlugins.getInstance().registerSchedulersHook(new RxAndroidSchedulersHook() {
@Override
public Scheduler getMainThreadScheduler() {
return Schedulers.immediate();
}
});
} catch (IllegalStateException ignored) {
// already registered
}
}
示例9: replaceRxSchedulerWithAsyncTask
import rx.plugins.RxJavaHooks; //导入方法依赖的package包/类
private void replaceRxSchedulerWithAsyncTask() {
RxJavaHooks.setOnComputationScheduler(old -> Schedulers.from(AsyncTask.THREAD_POOL_EXECUTOR));
RxJavaHooks.setOnIOScheduler(old -> Schedulers.from(AsyncTask.THREAD_POOL_EXECUTOR));
RxJavaHooks.setOnNewThreadScheduler(old -> Schedulers.from(AsyncTask.THREAD_POOL_EXECUTOR));
}
示例10: initRxSchedulers
import rx.plugins.RxJavaHooks; //导入方法依赖的package包/类
public void initRxSchedulers(Vertx vertx) {
RxJavaSchedulersHook hook = RxHelper.schedulerHook(vertx);
RxJavaHooks.setOnIOScheduler(f -> hook.getIOScheduler());
RxJavaHooks.setOnNewThreadScheduler(f -> hook.getNewThreadScheduler());
RxJavaHooks.setOnComputationScheduler(f -> hook.getComputationScheduler());
}
示例11: schedulerHook
import rx.plugins.RxJavaHooks; //导入方法依赖的package包/类
public void schedulerHook(Vertx vertx) {
RxJavaSchedulersHook hook = RxHelper.schedulerHook(vertx);
RxJavaHooks.setOnIOScheduler(f -> hook.getIOScheduler());
RxJavaHooks.setOnNewThreadScheduler(f -> hook.getNewThreadScheduler());
RxJavaHooks.setOnComputationScheduler(f -> hook.getComputationScheduler());
}
示例12: schedulerHook
import rx.plugins.RxJavaHooks; //导入方法依赖的package包/类
public void schedulerHook(Vertx vertx) {
RxJavaSchedulersHook hook = io.vertx.rxjava.core.RxHelper.schedulerHook(vertx);
RxJavaHooks.setOnIOScheduler(f -> hook.getIOScheduler());
RxJavaHooks.setOnNewThreadScheduler(f -> hook.getNewThreadScheduler());
RxJavaHooks.setOnComputationScheduler(f -> hook.getComputationScheduler());
}