Class Completables

    • Method Detail

      • flatMapMaybe

        public static <R> CompletableConverter<Maybe<R>> flatMapMaybe​(Supplier<? extends MaybeSource<? extends R>> onCompleteHandler,
                                                                      Function<? super java.lang.Throwable,​? extends MaybeSource<? extends R>> onErrorHandler)
        Maps the terminal signals of the upstream into MaybeSources and subscribes to it, relaying its terminal events to the downstream.
        Type Parameters:
        R - the element type of the mapped-in MaybeSource
        Parameters:
        onCompleteHandler - called when the upstream completes normally and should return the MaybeSource to continue with.
        onErrorHandler - called when the upstream fails and should return the MaybeSource for the given Throwable instance to continue with.
        Returns:
        the new CompletableConverter instance
        Since:
        0.20.2
      • flatMapSingle

        public static <R> CompletableConverter<Single<R>> flatMapSingle​(Supplier<? extends SingleSource<? extends R>> onCompleteHandler,
                                                                        Function<? super java.lang.Throwable,​? extends SingleSource<? extends R>> onErrorHandler)
        Maps the terminal signals of the upstream into SingleSources and subscribes to it, relaying its terminal events to the downstream.
        Type Parameters:
        R - the element type of the mapped-in SingleSource
        Parameters:
        onCompleteHandler - called when the upstream completes normally and should return the SingleSource to continue with.
        onErrorHandler - called when the upstream fails and should return the SingleSource for the given Throwable instance to continue with.
        Returns:
        the new CompletableConverter instance
        Since:
        0.20.2
      • flatMapObservable

        public static <R> CompletableConverter<Observable<R>> flatMapObservable​(Supplier<? extends ObservableSource<? extends R>> onCompleteHandler,
                                                                                Function<? super java.lang.Throwable,​? extends ObservableSource<? extends R>> onErrorHandler)
        Maps the terminal signals of the upstream into ObservableSources and subscribes to it, relaying its terminal events to the downstream.
        Type Parameters:
        R - the element type of the mapped-in ObservableSource
        Parameters:
        onCompleteHandler - called when the upstream completes normally and should return the SingleSource to continue with.
        onErrorHandler - called when the upstream fails and should return the ObservableSource for the given Throwable instance to continue with.
        Returns:
        the new CompletableConverter instance
        Since:
        0.20.2
      • flatMapFlowable

        public static <R> CompletableConverter<Flowable<R>> flatMapFlowable​(Supplier<? extends Publisher<? extends R>> onCompleteHandler,
                                                                            Function<? super java.lang.Throwable,​? extends Publisher<? extends R>> onErrorHandler)
        Maps the terminal signals of the upstream into Publishers and subscribes to it, relaying its terminal events to the downstream.
        Type Parameters:
        R - the element type of the mapped-in ObservableSource
        Parameters:
        onCompleteHandler - called when the upstream completes normally and should return the Publisher to continue with.
        onErrorHandler - called when the upstream fails and should return the Publisher for the given Throwable instance to continue with.
        Returns:
        the new CompletableConverter instance
        Since:
        0.20.2