Interface Completable

  • All Superinterfaces:
    org.reactivestreams.Publisher<Void>

    public interface Completable
    extends org.reactivestreams.Publisher<Void>
    Completable is used to communicates a terminated operation which doesn't produce a result. It extends Publisher by providing additional reactive methods allowing to act on it. The goal of this interface is to decouple ourself from reactive framework (RxJava/Reactor).
    • Method Detail

      • onErrorResumeWith

        Completable onErrorResumeWith​(org.forgerock.util.Function<Throwable,​Completable,​Exception> function)
        When an error occurs in this completable, continue the processing with the new Completable provided by the function.
        Parameters:
        function - Generates the stream which must will used to resume operation when this Completable failed.
        Returns:
        A new Completable
      • doAfterTerminate

        Completable doAfterTerminate​(Action onAfterTerminate)
        Returns a Completable instance that calls the given onTerminate callback after this Completable completes normally or with an exception.
        Parameters:
        onAfterTerminate - the callback to call after this Completable terminates
        Returns:
        the new Completable instance
      • toSingle

        <V> Single<V> toSingle​(V value)
        Returns a Single which will complete with the provided value once this Completable completes.
        Type Parameters:
        V - Type of the value to emit
        Parameters:
        value - The value to emit on completion
        Returns:
        A new Single
      • subscribe

        void subscribe​(Action completeAction,
                       Consumer<Throwable> errorConsumer)
        Subscribe to the result of this Completable.
        Parameters:
        completeAction - An Action which will be invoked on successful completion
        errorConsumer - A Consumer which will be invoked on error
      • subscribe

        void subscribe()
        Subscribes to this Completable.