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


Java Schedulers.from方法代码示例

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


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

示例1: RxWrapperDocumentClientImpl

import rx.schedulers.Schedulers; //导入方法依赖的package包/类
public RxWrapperDocumentClientImpl(DocumentClient client) {
    this.client = client;

    int maxThreads = (int) (client.getConnectionPolicy().getMaxPoolSize() * 1.1);
    this.executorService =  new ThreadPoolExecutor(
            Math.min(8, maxThreads), // core thread pool size
            maxThreads, // maximum thread pool size
            30, // time to wait before killing idle threads
            TimeUnit.SECONDS, 
            new SynchronousQueue<>(),
            new RxThreadFactory("RxDocdb-io"),
            new ThreadPoolExecutor.CallerRunsPolicy());
    this.scheduler = Schedulers.from(executorService);
}
 
开发者ID:Azure,项目名称:azure-documentdb-rxjava,代码行数:15,代码来源:RxWrapperDocumentClientImpl.java

示例2: setUp

import rx.schedulers.Schedulers; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
    sharedPreferences =
            RuntimeEnvironment.application.getSharedPreferences(SimpleUploadDataStore.JOB_REPO,
                    Context.MODE_PRIVATE);
    final Scheduler worker = Schedulers.from(Executors.newSingleThreadExecutor());
    dataStore = new SimpleUploadDataStore(sharedPreferences, worker);
    gson = new GsonBuilder()
            .registerTypeAdapterFactory(JobTypeAdapterFactory.create())
            .create();
}
 
开发者ID:jsaund,项目名称:RxUploader,代码行数:12,代码来源:SimpleUploadDataStoreTest.java

示例3: scheduler

import rx.schedulers.Schedulers; //导入方法依赖的package包/类
/**
 * Specify the scheduler for CSApp to use for background work (e.g. syncing)
 *
 * @param executorService the executorService CSApp will use to sync and cache data.
 */
public Builder scheduler(ScheduledExecutorService executorService) {
  this.scheduler = Schedulers.from(executorService);
  return this;
}
 
开发者ID:csync,项目名称:csync-android,代码行数:10,代码来源:CSApp.java


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