本文整理汇总了Java中io.reactivex.Flowable.compose方法的典型用法代码示例。如果您正苦于以下问题:Java Flowable.compose方法的具体用法?Java Flowable.compose怎么用?Java Flowable.compose使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.reactivex.Flowable
的用法示例。
在下文中一共展示了Flowable.compose方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: build
import io.reactivex.Flowable; //导入方法依赖的package包/类
public Flowable<T> build(boolean applySchedular)
{
Flowable<T> flowable = null;
if (mKeys != null)
{
for (int i = 0; i < mKeys.size(); i++)
{
if (i == 0)
flowable = RxBus.getInstance().observeEvent(mKeys.get(i));
else
flowable = flowable.mergeWith(RxBus.getInstance().observeEvent(mKeys.get(i)));
}
}
else
flowable = RxBus.getInstance().observeEvent(mEventClass);
if (mBackpressureBeforeValve)
flowable = flowable.onBackpressureBuffer();
if (mQueuer != null)
flowable = flowable.compose(FlowableTransformers.valve(mQueuer.getResumeObservable(), mQueuer.isBusResumed(), mValvePrefetch));
if (applySchedular)
flowable = applySchedular(flowable);
return flowable;
}
示例2: subscribe
import io.reactivex.Flowable; //导入方法依赖的package包/类
public <R> Disposable subscribe(Consumer<R> onNext, Consumer<Throwable> onError, Action onCompleted, FlowableTransformer<T, R> transformer)
{
Flowable flowable = build(false);
if (transformer != null)
flowable = flowable.compose(transformer);
if (onNext == null)
onNext = data -> {};
if (onError == null)
onError = error -> { throw new OnErrorNotImplementedException(error); };
if (onCompleted == null)
onCompleted = () -> {};
Consumer<R> actualOnNext = onNext;
if (mQueuer != null && mQueueSubscriptionSafetyCheckEnabled)
actualOnNext = RxBusUtil.wrapQueueConsumer(onNext, mQueuer);
flowable = applySchedular(flowable);
Disposable disposable = flowable.subscribe(actualOnNext, onError, onCompleted);
if (mBoundObject != null)
RxDisposableManager.addDisposable(mBoundObject, disposable);
return disposable;
}
示例3: applySchedular
import io.reactivex.Flowable; //导入方法依赖的package包/类
private Flowable<T> applySchedular(Flowable<T> flowable)
{
if (mBusMode == RxBusMode.Background)
return flowable.compose(RxUtil.<T>applyBackgroundSchedulers());
else if (mBusMode == RxBusMode.Main)
return flowable.compose(RxUtil.<T>applySchedulars());
return flowable;
}
示例4: apply
import io.reactivex.Flowable; //导入方法依赖的package包/类
@Override public Publisher<T> apply(Flowable<T> upstream) {
HideAtStartShowAtError<T> delegate = new HideAtStartShowAtError<>(
view.hideErrorState(),
view.showErrorState(),
error -> !(error instanceof ContentNotFoundError),
uiScheduler
);
return upstream.compose(delegate);
}
示例5: apply
import io.reactivex.Flowable; //导入方法依赖的package包/类
@Override public Publisher<T> apply(Flowable<T> upstream) {
ShowAtStartHideWhenDone<T> delegate = new ShowAtStartHideWhenDone<>(
view.showLoading(),
view.hideLoading(),
uiScheduler
);
return upstream.compose(delegate);
}
示例6: apply
import io.reactivex.Flowable; //导入方法依赖的package包/类
@Override public Publisher<T> apply(Flowable<T> upstream) {
HideAtStartShowAtError<T> delegate = new HideAtStartShowAtError<>(
view.hideEmptyState(),
view.showEmptyState(),
error -> error instanceof ContentNotFoundError,
uiScheduler
);
return upstream.compose(delegate);
}
示例7: execute
import io.reactivex.Flowable; //导入方法依赖的package包/类
public void execute(Subscriber subscriber, FlowableTransformer transformer) {
Flowable flowable = getFlowable();
if (flowable == null) {
return;
}
if (transformer != null) {
flowable = flowable.compose(transformer);
}
flowable.observeOn(AndroidSchedulers.mainThread())
.subscribeOn(Schedulers.io())
.subscribe(subscriber);
}