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


Java RxJavaHooks.setOnComputationScheduler方法代码示例

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


在下文中一共展示了RxJavaHooks.setOnComputationScheduler方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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(rxAndroidSchedulersHook);

            RxJavaHooks.reset();
            RxJavaHooks.setOnIOScheduler(rxJavaSchedulerHook);
            RxJavaHooks.setOnNewThreadScheduler(rxJavaSchedulerHook);
            RxJavaHooks.setOnComputationScheduler(rxJavaSchedulerHook);

            base.evaluate();

            RxAndroidPlugins.getInstance().reset();
            RxJavaHooks.reset();
        }
    };
}
 
开发者ID:Plastix,项目名称:RxSchedulerRule,代码行数:21,代码来源:RxSchedulerRule.java

示例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 {
            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();
        }
    };
}
 
开发者ID:AnironGlass,项目名称:MVP-Boilerplate,代码行数:21,代码来源:RxSchedulersRule.java

示例3: setupTestSchedulers

import rx.plugins.RxJavaHooks; //导入方法依赖的package包/类
public static void setupTestSchedulers() {
    try {
        RxJavaHooks.setOnIOScheduler(current -> Schedulers.immediate());
        RxJavaHooks.setOnComputationScheduler(current -> Schedulers.immediate());

        RxAndroidPlugins.getInstance().registerSchedulersHook(new RxAndroidSchedulersHook() {
            @Override
            public Scheduler getMainThreadScheduler() {
                return Schedulers.immediate();
            }
        });
    } catch (IllegalStateException ignored) {
    }
}
 
开发者ID:ArturVasilov,项目名称:AndroidArchitecture,代码行数:15,代码来源:MockUtils.java

示例4: 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();
        }
    });
}
 
开发者ID:850759383,项目名称:ZhihuDailyNews,代码行数:13,代码来源:RxTools.java

示例5: 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();
        }
    };
}
 
开发者ID:DanielSerdyukov,项目名称:droidcon2016,代码行数:15,代码来源:ImmediateSchedulerTestRule.java

示例6: setUp

import rx.plugins.RxJavaHooks; //导入方法依赖的package包/类
@Before
public void setUp() {
  RxJavaHooks.setOnComputationScheduler(new Func1<Scheduler, Scheduler>() {
    @Override
    public Scheduler call(Scheduler s) {
      return Schedulers.immediate();
    }
  });
  es = new MemoryEventStore();
}
 
开发者ID:manuelp,项目名称:jevsto,代码行数:11,代码来源:MemoryEventStoreTest.java

示例7: 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));
}
 
开发者ID:sumio,项目名称:RxJavaEspressoSample,代码行数:6,代码来源:ActivityAsyncTaskExecutorTest.java

示例8: 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());
}
 
开发者ID:pitchpoint-solutions,项目名称:sfs,代码行数:7,代码来源:SfsSingletonServer.java

示例9: 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());
}
 
开发者ID:vert-x3,项目名称:vertx-rx,代码行数:7,代码来源:NativeExamples.java

示例10: 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());
}
 
开发者ID:vert-x3,项目名称:vertx-rx,代码行数:7,代码来源:RxifiedExamples.java


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