本文整理匯總了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;
}
示例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);
}
示例3: FlowableCacheLast
import io.reactivex.processors.AsyncProcessor; //導入依賴的package包/類
FlowableCacheLast(Publisher<T> source) {
this.source = source;
this.processor = AsyncProcessor.create();
this.once = new AtomicBoolean();
}