當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。