當前位置: 首頁>>代碼示例>>Java>>正文


Java AsyncProcessor類代碼示例

本文整理匯總了Java中io.reactivex.processors.AsyncProcessor的典型用法代碼示例。如果您正苦於以下問題:Java AsyncProcessor類的具體用法?Java AsyncProcessor怎麽用?Java AsyncProcessor使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


AsyncProcessor類屬於io.reactivex.processors包,在下文中一共展示了AsyncProcessor類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: fromFuture

import io.reactivex.processors.AsyncProcessor; //導入依賴的package包/類
/**
 * Create a Flowable that signals the terminal value or error of the given
 * CompletionStage.
 * <p>Cancelling the Flowable subscription doesn't cancel the CompletionStage.
 * @param <T> the value type
 * @param cs the CompletionStage instance
 * @return the new Flowable instance
 */
public static <T> Flowable<T> fromFuture(CompletionStage<T> cs) {
    AsyncProcessor<T> ap = AsyncProcessor.create();
    cs.whenComplete((v, e) -> {
        if (e != null) {
            ap.onError(e);
        } else {
            ap.onNext(v);
            ap.onComplete();
        }
    });
    return ap;
}
 
開發者ID:akarnokd,項目名稱:RxJava2Jdk8Interop,代碼行數:21,代碼來源:FlowableInterop.java

示例2: getAppSettings

import io.reactivex.processors.AsyncProcessor; //導入依賴的package包/類
@Override
public void getAppSettings() {
    mSplashProcessor = AsyncProcessor.create();
    mSplashDisposable = mSplashProcessor.subscribeWith(new SplashSubscriber());
    new SplashRequestManager(deviceId).
            getAppConfig().
            subscribe(mSplashProcessor);
}
 
開發者ID:preraktrivedi,項目名稱:AndroidRxJava2MVVM,代碼行數:9,代碼來源:SplashViewModel.java

示例3: FlowableCacheLast

import io.reactivex.processors.AsyncProcessor; //導入依賴的package包/類
FlowableCacheLast(Publisher<T> source) {
    this.source = source;
    this.processor = AsyncProcessor.create();
    this.once = new AtomicBoolean();
}
 
開發者ID:akarnokd,項目名稱:RxJava2Extensions,代碼行數:6,代碼來源:FlowableCacheLast.java


注:本文中的io.reactivex.processors.AsyncProcessor類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。