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


Java Flowable.compose方法代码示例

本文整理汇总了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;
}
 
开发者ID:MFlisar,项目名称:RxBus2,代码行数:26,代码来源:RxBusBuilder.java

示例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;
}
 
开发者ID:MFlisar,项目名称:RxBus2,代码行数:24,代码来源:RxBusBuilder.java

示例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;
}
 
开发者ID:MFlisar,项目名称:RxBus2,代码行数:9,代码来源:RxBusBuilder.java

示例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);
}
 
开发者ID:ubiratansoares,项目名称:reactive-architectures-playground,代码行数:11,代码来源:AssignErrorState.java

示例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);
    }
 
开发者ID:ubiratansoares,项目名称:reactive-architectures-playground,代码行数:11,代码来源:LoadingCoordination.java

示例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);
    }
 
开发者ID:ubiratansoares,项目名称:reactive-architectures-playground,代码行数:12,代码来源:AssignEmptyState.java

示例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);
    }
 
开发者ID:xiaoxige,项目名称:AutoNet,代码行数:14,代码来源:BaseUsecase.java


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