本文整理汇总了Java中io.reactivex.plugins.RxJavaPlugins.setIoSchedulerHandler方法的典型用法代码示例。如果您正苦于以下问题:Java RxJavaPlugins.setIoSchedulerHandler方法的具体用法?Java RxJavaPlugins.setIoSchedulerHandler怎么用?Java RxJavaPlugins.setIoSchedulerHandler使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.reactivex.plugins.RxJavaPlugins
的用法示例。
在下文中一共展示了RxJavaPlugins.setIoSchedulerHandler方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: apply
import io.reactivex.plugins.RxJavaPlugins; //导入方法依赖的package包/类
@Override
public Statement apply(final Statement base, final Description description) {
return new Statement() {
@Override
public void evaluate() throws Throwable {
RxJavaPlugins.setIoSchedulerHandler(scheduler -> testScheduler);
RxJavaPlugins.setComputationSchedulerHandler(scheduler -> testScheduler);
RxJavaPlugins.setNewThreadSchedulerHandler(scheduler -> testScheduler);
try {
base.evaluate();
} finally {
RxJavaPlugins.reset();
}
}
};
}
示例2: apply
import io.reactivex.plugins.RxJavaPlugins; //导入方法依赖的package包/类
@Override
public Statement apply(final Statement base, Description description) {
return new Statement() {
@Override
public void evaluate() throws Throwable {
RxJavaPlugins.reset();
RxJavaPlugins.setIoSchedulerHandler(scheduler -> Schedulers.trampoline());
RxJavaPlugins.setComputationSchedulerHandler(scheduler -> Schedulers.trampoline());
RxJavaPlugins.setNewThreadSchedulerHandler(scheduler -> Schedulers.trampoline());
try {
base.evaluate();
} finally {
RxJavaPlugins.reset();
}
}
};
}
示例3: apply
import io.reactivex.plugins.RxJavaPlugins; //导入方法依赖的package包/类
@Override
public Statement apply(Statement base, Description description) {
return new Statement() {
@Override
public void evaluate() throws Throwable {
RxAndroidPlugins.reset();
RxAndroidPlugins.setInitMainThreadSchedulerHandler(scheduler -> Schedulers.trampoline());
RxJavaPlugins.reset();
RxJavaPlugins.setIoSchedulerHandler(schedulerCallable -> Schedulers.trampoline());
base.evaluate();
RxAndroidPlugins.reset();
RxJavaPlugins.reset();
}
};
}
示例4: before
import io.reactivex.plugins.RxJavaPlugins; //导入方法依赖的package包/类
@Override
protected void before() throws Throwable {
IdlingResourceScheduler ioIdlingScheduler =
Rx2Idler.wrap(Schedulers.io(), "RxJava2 Io Idling Scheduler");
IdlingResourceScheduler computationIdlingScheduler =
Rx2Idler.wrap(Schedulers.io(), "RxJava2 Computation Idling Scheduler");
IdlingResourceScheduler newThreadIdlingScheduler =
Rx2Idler.wrap(Schedulers.io(), "RxJava2 New Thread Idling Scheduler");
Espresso.registerIdlingResources(
ioIdlingScheduler, computationIdlingScheduler, newThreadIdlingScheduler
);
RxJavaPlugins.setIoSchedulerHandler(scheduler1 -> ioIdlingScheduler);
RxJavaPlugins.setInitComputationSchedulerHandler(scheduler1 -> computationIdlingScheduler);
RxJavaPlugins.setComputationSchedulerHandler(scheduler1 -> computationIdlingScheduler);
RxJavaPlugins.setNewThreadSchedulerHandler(scheduler1 -> newThreadIdlingScheduler);
}
示例5: apply
import io.reactivex.plugins.RxJavaPlugins; //导入方法依赖的package包/类
@Override
public Statement apply(final Statement base, Description description) {
return new Statement() {
@Override
public void evaluate() throws Throwable {
RxJavaPlugins.setIoSchedulerHandler(scheduler ->
Schedulers.trampoline());
RxJavaPlugins.setComputationSchedulerHandler(scheduler ->
Schedulers.trampoline());
RxJavaPlugins.setNewThreadSchedulerHandler(scheduler ->
Schedulers.trampoline());
try {
base.evaluate();
} finally {
RxJavaPlugins.reset();
}
}
};
}
示例6: apply
import io.reactivex.plugins.RxJavaPlugins; //导入方法依赖的package包/类
@Override
public Statement apply(final Statement base, Description description) {
return new Statement() {
@Override
public void evaluate() throws Throwable {
resetPlugins();
RxJavaPlugins.setIoSchedulerHandler(new Function<Scheduler, Scheduler>() {
@Override
public Scheduler apply(@NonNull Scheduler scheduler) throws Exception {
return Schedulers.trampoline();
}
});
base.evaluate();
resetPlugins();
}
};
}
示例7: apply
import io.reactivex.plugins.RxJavaPlugins; //导入方法依赖的package包/类
@Override
public Statement apply(final Statement base, Description description) {
return new Statement() {
@Override
public void evaluate() throws Throwable {
RxAndroidPlugins.reset();
RxAndroidPlugins.setMainThreadSchedulerHandler(scheduler -> Schedulers.trampoline());
RxJavaPlugins.reset();
RxJavaPlugins.setIoSchedulerHandler(scheduler -> Schedulers.trampoline());
RxJavaPlugins.setComputationSchedulerHandler(scheduler -> Schedulers.trampoline());
RxJavaPlugins.setNewThreadSchedulerHandler(scheduler -> Schedulers.trampoline());
base.evaluate();
RxAndroidPlugins.reset();
RxJavaPlugins.reset();
}
};
}
示例8: apply
import io.reactivex.plugins.RxJavaPlugins; //导入方法依赖的package包/类
@Override
public Statement apply(final Statement base, Description description) {
return new Statement() {
@Override
public void evaluate() throws Throwable {
RxAndroidPlugins.reset();
RxAndroidPlugins.setInitMainThreadSchedulerHandler(mRxAndroidSchedulersHook);
RxJavaPlugins.reset();
RxJavaPlugins.setIoSchedulerHandler(mRxJavaImmediateScheduler);
RxJavaPlugins.setNewThreadSchedulerHandler(mRxJavaImmediateScheduler);
base.evaluate();
RxAndroidPlugins.reset();
RxJavaPlugins.reset();
}
};
}
示例9: setupRxJavaPlugins
import io.reactivex.plugins.RxJavaPlugins; //导入方法依赖的package包/类
@BeforeClass
public static void setupRxJavaPlugins() {
RxJavaPlugins.setIoSchedulerHandler(new Function<Scheduler, Scheduler>() {
@Override
public Scheduler apply(Scheduler scheduler) throws Exception {
return Schedulers.trampoline();
}
});
RxAndroidPlugins.setInitMainThreadSchedulerHandler(new Function<Callable<Scheduler>, Scheduler>() {
@Override
public Scheduler apply(Callable<Scheduler> schedulerCallable) throws Exception {
return Schedulers.trampoline();
}
});
}
示例10: setupClass
import io.reactivex.plugins.RxJavaPlugins; //导入方法依赖的package包/类
@BeforeClass
public static void setupClass() {
RxAndroidPlugins.setInitMainThreadSchedulerHandler(new Function<Callable<Scheduler>, Scheduler>() {
@Override
public Scheduler apply(Callable<Scheduler> schedulerCallable) throws Exception {
return Schedulers.trampoline();
}
});
RxJavaPlugins.setIoSchedulerHandler(new Function<Scheduler, Scheduler>() {
@Override
public Scheduler apply(Scheduler scheduler) throws Exception {
return Schedulers.trampoline();
}
});
}
示例11: apply
import io.reactivex.plugins.RxJavaPlugins; //导入方法依赖的package包/类
@Override
public Statement apply(final Statement base, Description description) {
return new Statement() {
@Override
public void evaluate() throws Throwable {
RxJavaPlugins.setIoSchedulerHandler(scheduler -> Schedulers.trampoline());
RxJavaPlugins.setComputationSchedulerHandler(scheduler -> Schedulers.trampoline());
RxJavaPlugins.setNewThreadSchedulerHandler(scheduler -> Schedulers.trampoline());
RxAndroidPlugins.setMainThreadSchedulerHandler(scheduler -> Schedulers.trampoline());
try {
base.evaluate();
} finally {
RxJavaPlugins.reset();
}
}
};
}
示例12: init
import io.reactivex.plugins.RxJavaPlugins; //导入方法依赖的package包/类
public static void init(Function<? super Scheduler, ? extends Scheduler> scheduler) {
RxJavaPlugins.reset();
RxJavaPlugins.setIoSchedulerHandler(scheduler);
RxJavaPlugins.setNewThreadSchedulerHandler(scheduler);
}
示例13: replaceRxSchedulerWithAsyncTask
import io.reactivex.plugins.RxJavaPlugins; //导入方法依赖的package包/类
private void replaceRxSchedulerWithAsyncTask() {
RxJavaPlugins.setComputationSchedulerHandler(old -> Schedulers.from(AsyncTask.THREAD_POOL_EXECUTOR));
RxJavaPlugins.setIoSchedulerHandler(old -> Schedulers.from(AsyncTask.THREAD_POOL_EXECUTOR));
RxJavaPlugins.setNewThreadSchedulerHandler(old -> Schedulers.from(AsyncTask.THREAD_POOL_EXECUTOR));
}