rx

Class Single<T>

  • Type Parameters:
    T - the type of the item emitted by the Single


    @Experimental
    public class Single<T>
    extends Object
    The Single class implements the Reactive Pattern for a single value response. See Observable for the implementation of the Reactive Pattern for a stream or vector of values.

    Single behaves the same as Observable except that it can only emit either a single successful value, or an error (there is no "onComplete" notification as there is for Observable)

    Like an Observable, a Single is lazy, can be either "hot" or "cold", synchronous or asynchronous.

    The documentation for this class makes use of marble diagrams. The following legend explains these diagrams:

    For more information see the ReactiveX documentation.

    Since:
    (If this class graduates from "Experimental" replace this parenthetical with the release number)
    • Constructor Summary

      Constructors

      Modifier Constructor and Description
      protected Single(Single.OnSubscribe<T> f)
      Creates a Single with a Function to execute when it is subscribed to (executed).
    • Method Summary

      Modifier and Type Method and Description
      <R> Single<R> compose(Single.Transformer<? super T,? extends R> transformer)
      Transform a Single by applying a particular Transformer function to it.
      static <T> Observable<T> concat(Single<? extends T> t1, Single<? extends T> t2)
      Returns an Observable that emits the items emitted by two Singles, one after the other.
      static <T> Observable<T> concat(Single<? extends T> t1, Single<? extends T> t2, Single<? extends T> t3)
      Returns an Observable that emits the items emitted by three Singles, one after the other.
      static <T> Observable<T> concat(Single<? extends T> t1, Single<? extends T> t2, Single<? extends T> t3, Single<? extends T> t4)
      Returns an Observable that emits the items emitted by four Singles, one after the other.
      static <T> Observable<T> concat(Single<? extends T> t1, Single<? extends T> t2, Single<? extends T> t3, Single<? extends T> t4, Single<? extends T> t5)
      Returns an Observable that emits the items emitted by five Singles, one after the other.
      static <T> Observable<T> concat(Single<? extends T> t1, Single<? extends T> t2, Single<? extends T> t3, Single<? extends T> t4, Single<? extends T> t5, Single<? extends T> t6)
      Returns an Observable that emits the items emitted by six Singles, one after the other.
      static <T> Observable<T> concat(Single<? extends T> t1, Single<? extends T> t2, Single<? extends T> t3, Single<? extends T> t4, Single<? extends T> t5, Single<? extends T> t6, Single<? extends T> t7)
      Returns an Observable that emits the items emitted by seven Singles, one after the other.
      static <T> Observable<T> concat(Single<? extends T> t1, Single<? extends T> t2, Single<? extends T> t3, Single<? extends T> t4, Single<? extends T> t5, Single<? extends T> t6, Single<? extends T> t7, Single<? extends T> t8)
      Returns an Observable that emits the items emitted by eight Singles, one after the other.
      static <T> Observable<T> concat(Single<? extends T> t1, Single<? extends T> t2, Single<? extends T> t3, Single<? extends T> t4, Single<? extends T> t5, Single<? extends T> t6, Single<? extends T> t7, Single<? extends T> t8, Single<? extends T> t9)
      Returns an Observable that emits the items emitted by nine Singles, one after the other.
      Observable<T> concatWith(Single<? extends T> t1)
      Returns an Observable that emits the item emitted by the source Single, then the item emitted by the specified Single.
      static <T> Single<T> create(Single.OnSubscribe<T> f)
      Returns a Single that will execute the specified function when a SingleSubscriber executes it or a Subscriber subscribes to it.
      static <T> Single<T> defer(Callable<Single<T>> singleFactory)
      Returns a Single that calls a Single factory to create a Single for each new Observer that subscribes.
      Single<T> delay(long delay, TimeUnit unit)
      Returns an Single that emits the items emitted by the source Single shifted forward in time by a specified delay.
      Single<T> delay(long delay, TimeUnit unit, Scheduler scheduler)
      Returns an Single that emits the items emitted by the source Single shifted forward in time by a specified delay.
      Single<T> doOnError(Action1<Throwable> onError)
      Modifies the source Single so that it invokes an action if it calls onError.
      Single<T> doOnSuccess(Action1<? super T> onSuccess)
      Modifies the source Single so that it invokes an action when it calls onSuccess.
      static <T> Single<T> error(Throwable exception)
      Returns a Single that invokes a subscriber's onError method when the subscriber subscribes to it.
      <R> Single<R> flatMap(Func1<? super T,? extends Single<? extends R>> func)
      Returns a Single that is based on applying a specified function to the item emitted by the source Single, where that function returns a Single.
      <R> Observable<R> flatMapObservable(Func1<? super T,? extends Observable<? extends R>> func)
      Returns an Observable that emits items based on applying a specified function to the item emitted by the source Observable, where that function returns an Observable.
      static <T> Single<T> from(Future<? extends T> future)
      Converts a Future into a Single.
      static <T> Single<T> from(Future<? extends T> future, long timeout, TimeUnit unit)
      Converts a Future into a Single, with a timeout on the Future.
      static <T> Single<T> from(Future<? extends T> future, Scheduler scheduler)
      Converts a Future, operating on a specified Scheduler, into a Single.
      static <T> Single<T> fromCallable(Callable<? extends T> func)
      Returns a Single that invokes passed function and emits its result for each new Observer that subscribes.
      static <T> Single<T> just(T value)
      Returns a Single that emits a specified item.
      <R> Single<R> map(Func1<? super T,? extends R> func)
      Returns a Single that applies a specified function to the item emitted by the source Single and emits the result of this function application.
      static <T> Single<T> merge(Single<? extends Single<? extends T>> source)
      Flattens a Single that emits a Single into a single Single that emits the item emitted by the nested Single, without any transformation.
      static <T> Observable<T> merge(Single<? extends T> t1, Single<? extends T> t2)
      Flattens two Singles into a single Observable, without any transformation.
      static <T> Observable<T> merge(Single<? extends T> t1, Single<? extends T> t2, Single<? extends T> t3)
      Flattens three Singles into a single Observable, without any transformation.
      static <T> Observable<T> merge(Single<? extends T> t1, Single<? extends T> t2, Single<? extends T> t3, Single<? extends T> t4)
      Flattens four Singles into a single Observable, without any transformation.
      static <T> Observable<T> merge(Single<? extends T> t1, Single<? extends T> t2, Single<? extends T> t3, Single<? extends T> t4, Single<? extends T> t5)
      Flattens five Singles into a single Observable, without any transformation.
      static <T> Observable<T> merge(Single<? extends T> t1, Single<? extends T> t2, Single<? extends T> t3, Single<? extends T> t4, Single<? extends T> t5, Single<? extends T> t6)
      Flattens six Singles into a single Observable, without any transformation.
      static <T> Observable<T> merge(Single<? extends T> t1, Single<? extends T> t2, Single<? extends T> t3, Single<? extends T> t4, Single<? extends T> t5, Single<? extends T> t6, Single<? extends T> t7)
      Flattens seven Singles into a single Observable, without any transformation.
      static <T> Observable<T> merge(Single<? extends T> t1, Single<? extends T> t2, Single<? extends T> t3, Single<? extends T> t4, Single<? extends T> t5, Single<? extends T> t6, Single<? extends T> t7, Single<? extends T> t8)
      Flattens eight Singles into a single Observable, without any transformation.
      static <T> Observable<T> merge(Single<? extends T> t1, Single<? extends T> t2, Single<? extends T> t3, Single<? extends T> t4, Single<? extends T> t5, Single<? extends T> t6, Single<? extends T> t7, Single<? extends T> t8, Single<? extends T> t9)
      Flattens nine Singles into a single Observable, without any transformation.
      Observable<T> mergeWith(Single<? extends T> t1)
      Flattens this and another Single into a single Observable, without any transformation.
      Single<T> observeOn(Scheduler scheduler)
      Modifies a Single to emit its item (or notify of its error) on a specified Scheduler, asynchronously.
      Single<T> onErrorReturn(Func1<Throwable,? extends T> resumeFunction)
      Instructs a Single to emit an item (returned by a specified function) rather than invoking onError if it encounters an error.
      Subscription subscribe()
      Subscribes to a Single but ignore its emission or notification.
      Subscription subscribe(Action1<? super T> onSuccess)
      Subscribes to a Single and provides a callback to handle the item it emits.
      Subscription subscribe(Action1<? super T> onSuccess, Action1<Throwable> onError)
      Subscribes to a Single and provides callbacks to handle the item it emits or any error notification it issues.
      Subscription subscribe(SingleSubscriber<? super T> te)
      Subscribes to a Single and provides a SingleSubscriber that implements functions to handle the item the Single emits or any error notification it issues.
      Subscription subscribe(Subscriber<? super T> subscriber)
      Subscribes to a Single and provides a Subscriber that implements functions to handle the item the Single emits or any error notification it issues.
      Single<T> subscribeOn(Scheduler scheduler)
      Asynchronously subscribes subscribers to this Single on the specified Scheduler.
      Single<T> timeout(long timeout, TimeUnit timeUnit)
      Returns a Single that mirrors the source Single but applies a timeout policy for its emitted item.
      Single<T> timeout(long timeout, TimeUnit timeUnit, Scheduler scheduler)
      Returns a Single that mirrors the source Single but applies a timeout policy for its emitted item, where this policy is governed on a specified Scheduler.
      Single<T> timeout(long timeout, TimeUnit timeUnit, Single<? extends T> other)
      Returns a Single that mirrors the source Single but applies a timeout policy for its emitted item.
      Single<T> timeout(long timeout, TimeUnit timeUnit, Single<? extends T> other, Scheduler scheduler)
      Returns a Single that mirrors the source Single but applies a timeout policy for its emitted item, using a specified Scheduler.
      BlockingSingle<T> toBlocking()
      Converts a Single into a BlockingSingle (a Single with blocking operators).
      Observable<T> toObservable()
      Converts this Single into an Observable.
      void unsafeSubscribe(Subscriber<? super T> subscriber)
      Subscribes to a Single and invokes the Single.OnSubscribe function without any contract protection, error handling, unsubscribe, or execution hooks.
      static <T1,T2,R> Single<R> zip(Single<? extends T1> o1, Single<? extends T2> o2, Func2<? super T1,? super T2,? extends R> zipFunction)
      Returns a Single that emits the results of a specified combiner function applied to two items emitted by two other Singles.
      static <T1,T2,T3,R> Single<R> zip(Single<? extends T1> o1, Single<? extends T2> o2, Single<? extends T3> o3, Func3<? super T1,? super T2,? super T3,? extends R> zipFunction)
      Returns a Single that emits the results of a specified combiner function applied to three items emitted by three other Singles.
      static <T1,T2,T3,T4,R> Single<R> zip(Single<? extends T1> o1, Single<? extends T2> o2, Single<? extends T3> o3, Single<? extends T4> o4, Func4<? super T1,? super T2,? super T3,? super T4,? extends R> zipFunction)
      Returns an Observable that emits the results of a specified combiner function applied to four items emitted by four other Singles.
      static <T1,T2,T3,T4,T5,R> Single<R> zip(Single<? extends T1> o1, Single<? extends T2> o2, Single<? extends T3> o3, Single<? extends T4> o4, Single<? extends T5> o5, Func5<? super T1,? super T2,? super T3,? super T4,? super T5,? extends R> zipFunction)
      Returns an Observable that emits the results of a specified combiner function applied to five items emitted by five other Singles.
      static <T1,T2,T3,T4,T5,T6,R> Single<R> zip(Single<? extends T1> o1, Single<? extends T2> o2, Single<? extends T3> o3, Single<? extends T4> o4, Single<? extends T5> o5, Single<? extends T6> o6, Func6<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? extends R> zipFunction)
      Returns an Observable that emits the results of a specified combiner function applied to six items emitted by six other Singles.
      static <T1,T2,T3,T4,T5,T6,T7,R> Single<R> zip(Single<? extends T1> o1, Single<? extends T2> o2, Single<? extends T3> o3, Single<? extends T4> o4, Single<? extends T5> o5, Single<? extends T6> o6, Single<? extends T7> o7, Func7<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? extends R> zipFunction)
      Returns an Observable that emits the results of a specified combiner function applied to seven items emitted by seven other Singles.
      static <T1,T2,T3,T4,T5,T6,T7,T8,R> Single<R> zip(Single<? extends T1> o1, Single<? extends T2> o2, Single<? extends T3> o3, Single<? extends T4> o4, Single<? extends T5> o5, Single<? extends T6> o6, Single<? extends T7> o7, Single<? extends T8> o8, Func8<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? super T8,? extends R> zipFunction)
      Returns an Observable that emits the results of a specified combiner function applied to eight items emitted by eight other Singles.
      static <T1,T2,T3,T4,T5,T6,T7,T8,T9,R> Single<R> zip(Single<? extends T1> o1, Single<? extends T2> o2, Single<? extends T3> o3, Single<? extends T4> o4, Single<? extends T5> o5, Single<? extends T6> o6, Single<? extends T7> o7, Single<? extends T8> o8, Single<? extends T9> o9, Func9<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? super T8,? super T9,? extends R> zipFunction)
      Returns an Observable that emits the results of a specified combiner function applied to nine items emitted by nine other Singles.
      <T2,R> Single<R> zipWith(Single<? extends T2> other, Func2<? super T,? super T2,? extends R> zipFunction)
      Returns a Single that emits the result of applying a specified function to the pair of items emitted by the source Single and another specified Single.
    • Constructor Detail

      • Single

        protected Single(Single.OnSubscribe<T> f)
        Creates a Single with a Function to execute when it is subscribed to (executed).

        Note: Use create(OnSubscribe) to create a Single, instead of this constructor, unless you specifically have a need for inheritance.

        Parameters:
        f - OnExecute to be executed when execute(SingleSubscriber) or subscribe(Subscriber) is called
    • Method Detail

      • create

        public static final <T> Single<T> create(Single.OnSubscribe<T> f)
        Returns a Single that will execute the specified function when a SingleSubscriber executes it or a Subscriber subscribes to it.

        Write the function you pass to create so that it behaves as a Single: It should invoke the SingleSubscriber onSuccess and/or onError methods appropriately.

        A well-formed Single must invoke either the SingleSubscriber's onSuccess method exactly once or its onError method exactly once.

        Scheduler:
        create does not operate by default on a particular Scheduler.
        Type Parameters:
        T - the type of the item that this Single emits
        Parameters:
        f - a function that accepts an SingleSubscriber<T>, and invokes its onSuccess or onError methods as appropriate
        Returns:
        a Single that, when a Subscriber subscribes to it, will execute the specified function
        See Also:
        ReactiveX operators documentation: Create
      • compose

        public <R> Single<R> compose(Single.Transformer<? super T,? extends R> transformer)
        Transform a Single by applying a particular Transformer function to it.

        This method operates on the Single itself whereas lift(rx.Observable.Operator<? extends R, ? super T>) operates on the Single's Subscribers or Observers.

        If the operator you are creating is designed to act on the individual item emitted by a Single, use lift(rx.Observable.Operator<? extends R, ? super T>). If your operator is designed to transform the source Single as a whole (for instance, by applying a particular set of existing RxJava operators to it) use compose.

        Scheduler:
        compose does not operate by default on a particular Scheduler.
        Parameters:
        transformer - implements the function that transforms the source Single
        Returns:
        the source Single, transformed by the transformer function
        See Also:
        RxJava wiki: Implementing Your Own Operators
      • concat

        public static final <T> Observable<T> concat(Single<? extends T> t1,
                                                     Single<? extends T> t2)
        Returns an Observable that emits the items emitted by two Singles, one after the other.

        Scheduler:
        concat does not operate by default on a particular Scheduler.
        Parameters:
        t1 - an Single to be concatenated
        t2 - an Single to be concatenated
        Returns:
        an Observable that emits items emitted by the two source Singles, one after the other.
        See Also:
        ReactiveX operators documentation: Concat
      • concat

        public static final <T> Observable<T> concat(Single<? extends T> t1,
                                                     Single<? extends T> t2,
                                                     Single<? extends T> t3)
        Returns an Observable that emits the items emitted by three Singles, one after the other.

        Scheduler:
        concat does not operate by default on a particular Scheduler.
        Parameters:
        t1 - a Single to be concatenated
        t2 - a Single to be concatenated
        t3 - a Single to be concatenated
        Returns:
        an Observable that emits items emitted by the three source Singles, one after the other.
        See Also:
        ReactiveX operators documentation: Concat
      • concat

        public static final <T> Observable<T> concat(Single<? extends T> t1,
                                                     Single<? extends T> t2,
                                                     Single<? extends T> t3,
                                                     Single<? extends T> t4)
        Returns an Observable that emits the items emitted by four Singles, one after the other.

        Scheduler:
        concat does not operate by default on a particular Scheduler.
        Parameters:
        t1 - a Single to be concatenated
        t2 - a Single to be concatenated
        t3 - a Single to be concatenated
        t4 - a Single to be concatenated
        Returns:
        an Observable that emits items emitted by the four source Singles, one after the other.
        See Also:
        ReactiveX operators documentation: Concat
      • concat

        public static final <T> Observable<T> concat(Single<? extends T> t1,
                                                     Single<? extends T> t2,
                                                     Single<? extends T> t3,
                                                     Single<? extends T> t4,
                                                     Single<? extends T> t5)
        Returns an Observable that emits the items emitted by five Singles, one after the other.

        Scheduler:
        concat does not operate by default on a particular Scheduler.
        Parameters:
        t1 - a Single to be concatenated
        t2 - a Single to be concatenated
        t3 - a Single to be concatenated
        t4 - a Single to be concatenated
        t5 - a Single to be concatenated
        Returns:
        an Observable that emits items emitted by the five source Singles, one after the other.
        See Also:
        ReactiveX operators documentation: Concat
      • concat

        public static final <T> Observable<T> concat(Single<? extends T> t1,
                                                     Single<? extends T> t2,
                                                     Single<? extends T> t3,
                                                     Single<? extends T> t4,
                                                     Single<? extends T> t5,
                                                     Single<? extends T> t6)
        Returns an Observable that emits the items emitted by six Singles, one after the other.

        Scheduler:
        concat does not operate by default on a particular Scheduler.
        Parameters:
        t1 - a Single to be concatenated
        t2 - a Single to be concatenated
        t3 - a Single to be concatenated
        t4 - a Single to be concatenated
        t5 - a Single to be concatenated
        t6 - a Single to be concatenated
        Returns:
        an Observable that emits items emitted by the six source Singles, one after the other.
        See Also:
        ReactiveX operators documentation: Concat
      • concat

        public static final <T> Observable<T> concat(Single<? extends T> t1,
                                                     Single<? extends T> t2,
                                                     Single<? extends T> t3,
                                                     Single<? extends T> t4,
                                                     Single<? extends T> t5,
                                                     Single<? extends T> t6,
                                                     Single<? extends T> t7)
        Returns an Observable that emits the items emitted by seven Singles, one after the other.

        Scheduler:
        concat does not operate by default on a particular Scheduler.
        Parameters:
        t1 - a Single to be concatenated
        t2 - a Single to be concatenated
        t3 - a Single to be concatenated
        t4 - a Single to be concatenated
        t5 - a Single to be concatenated
        t6 - a Single to be concatenated
        t7 - a Single to be concatenated
        Returns:
        an Observable that emits items emitted by the seven source Singles, one after the other.
        See Also:
        ReactiveX operators documentation: Concat
      • concat

        public static final <T> Observable<T> concat(Single<? extends T> t1,
                                                     Single<? extends T> t2,
                                                     Single<? extends T> t3,
                                                     Single<? extends T> t4,
                                                     Single<? extends T> t5,
                                                     Single<? extends T> t6,
                                                     Single<? extends T> t7,
                                                     Single<? extends T> t8)
        Returns an Observable that emits the items emitted by eight Singles, one after the other.

        Scheduler:
        concat does not operate by default on a particular Scheduler.
        Parameters:
        t1 - a Single to be concatenated
        t2 - a Single to be concatenated
        t3 - a Single to be concatenated
        t4 - a Single to be concatenated
        t5 - a Single to be concatenated
        t6 - a Single to be concatenated
        t7 - a Single to be concatenated
        t8 - a Single to be concatenated
        Returns:
        an Observable that emits items emitted by the eight source Singles, one after the other.
        See Also:
        ReactiveX operators documentation: Concat
      • concat

        public static final <T> Observable<T> concat(Single<? extends T> t1,
                                                     Single<? extends T> t2,
                                                     Single<? extends T> t3,
                                                     Single<? extends T> t4,
                                                     Single<? extends T> t5,
                                                     Single<? extends T> t6,
                                                     Single<? extends T> t7,
                                                     Single<? extends T> t8,
                                                     Single<? extends T> t9)
        Returns an Observable that emits the items emitted by nine Singles, one after the other.

        Scheduler:
        concat does not operate by default on a particular Scheduler.
        Parameters:
        t1 - a Single to be concatenated
        t2 - a Single to be concatenated
        t3 - a Single to be concatenated
        t4 - a Single to be concatenated
        t5 - a Single to be concatenated
        t6 - a Single to be concatenated
        t7 - a Single to be concatenated
        t8 - a Single to be concatenated
        t9 - a Single to be concatenated
        Returns:
        an Observable that emits items emitted by the nine source Singles, one after the other.
        See Also:
        ReactiveX operators documentation: Concat
      • error

        public static final <T> Single<T> error(Throwable exception)
        Returns a Single that invokes a subscriber's onError method when the subscriber subscribes to it.

        Scheduler:
        error does not operate by default on a particular Scheduler.
        Type Parameters:
        T - the type of the item (ostensibly) emitted by the Single
        Parameters:
        exception - the particular Throwable to pass to onError
        Returns:
        a Single that invokes the subscriber's onError method when the subscriber subscribes to it
        See Also:
        ReactiveX operators documentation: Throw
      • from

        public static final <T> Single<T> from(Future<? extends T> future)
        Converts a Future into a Single.

        You can convert any object that supports the Future interface into a Single that emits the return value of the Future.get() method of that object, by passing the object into the from method.

        Important note: This Single is blocking; you cannot unsubscribe from it.

        Scheduler:
        from does not operate by default on a particular Scheduler.
        Type Parameters:
        T - the type of object that the Future returns, and also the type of item to be emitted by the resulting Single
        Parameters:
        future - the source Future
        Returns:
        a Single that emits the item from the source Future
        See Also:
        ReactiveX operators documentation: From
      • from

        public static final <T> Single<T> from(Future<? extends T> future,
                                               long timeout,
                                               TimeUnit unit)
        Converts a Future into a Single, with a timeout on the Future.

        You can convert any object that supports the Future interface into a Single that emits the return value of the Future.get() method of that object, by passing the object into the from method.

        Important note: This Single is blocking; you cannot unsubscribe from it.

        Scheduler:
        from does not operate by default on a particular Scheduler.
        Type Parameters:
        T - the type of object that the Future returns, and also the type of item to be emitted by the resulting Single
        Parameters:
        future - the source Future
        timeout - the maximum time to wait before calling get
        unit - the TimeUnit of the timeout argument
        Returns:
        a Single that emits the item from the source Future
        See Also:
        ReactiveX operators documentation: From
      • from

        public static final <T> Single<T> from(Future<? extends T> future,
                                               Scheduler scheduler)
        Converts a Future, operating on a specified Scheduler, into a Single.

        You can convert any object that supports the Future interface into a Single that emits the return value of the Future.get() method of that object, by passing the object into the from method.

        Scheduler:
        you specify which Scheduler this operator will use
        Type Parameters:
        T - the type of object that the Future returns, and also the type of item to be emitted by the resulting Single
        Parameters:
        future - the source Future
        scheduler - the Scheduler to wait for the Future on. Use a Scheduler such as Schedulers.io() that can block and wait on the Future
        Returns:
        a Single that emits the item from the source Future
        See Also:
        ReactiveX operators documentation: From
      • fromCallable

        @Experimental
        public static <T> Single<T> fromCallable(Callable<? extends T> func)
        Returns a Single that invokes passed function and emits its result for each new Observer that subscribes.

        Allows you to defer execution of passed function until Observer subscribes to the Single. It makes passed function "lazy". Result of the function invocation will be emitted by the Single.

        Scheduler:
        fromCallable does not operate by default on a particular Scheduler.
        Type Parameters:
        T - the type of the item emitted by the Single.
        Parameters:
        func - function which execution should be deferred, it will be invoked when Observer will subscribe to the Single.
        Returns:
        a Single whose Observers' subscriptions trigger an invocation of the given function.
      • just

        public static final <T> Single<T> just(T value)
        Returns a Single that emits a specified item.

        To convert any object into a Single that emits that object, pass that object into the just method.

        Scheduler:
        just does not operate by default on a particular Scheduler.
        Type Parameters:
        T - the type of that item
        Parameters:
        value - the item to emit
        Returns:
        a Single that emits value
        See Also:
        ReactiveX operators documentation: Just
      • merge

        public static final <T> Single<T> merge(Single<? extends Single<? extends T>> source)
        Flattens a Single that emits a Single into a single Single that emits the item emitted by the nested Single, without any transformation.

        Scheduler:
        merge does not operate by default on a particular Scheduler.
        Parameters:
        source - a Single that emits a Single
        Returns:
        a Single that emits the item that is the result of flattening the Single emitted by source
        See Also:
        ReactiveX operators documentation: Merge
      • merge

        public static final <T> Observable<T> merge(Single<? extends T> t1,
                                                    Single<? extends T> t2)
        Flattens two Singles into a single Observable, without any transformation.

        You can combine items emitted by multiple Singles so that they appear as a single Observable, by using the merge method.

        Scheduler:
        merge does not operate by default on a particular Scheduler.
        Parameters:
        t1 - a Single to be merged
        t2 - a Single to be merged
        Returns:
        an Observable that emits all of the items emitted by the source Singles
        See Also:
        ReactiveX operators documentation: Merge
      • merge

        public static final <T> Observable<T> merge(Single<? extends T> t1,
                                                    Single<? extends T> t2,
                                                    Single<? extends T> t3)
        Flattens three Singles into a single Observable, without any transformation.

        You can combine items emitted by multiple Singles so that they appear as a single Observable, by using the merge method.

        Scheduler:
        merge does not operate by default on a particular Scheduler.
        Parameters:
        t1 - a Single to be merged
        t2 - a Single to be merged
        t3 - a Single to be merged
        Returns:
        an Observable that emits all of the items emitted by the source Singles
        See Also:
        ReactiveX operators documentation: Merge
      • merge

        public static final <T> Observable<T> merge(Single<? extends T> t1,
                                                    Single<? extends T> t2,
                                                    Single<? extends T> t3,
                                                    Single<? extends T> t4)
        Flattens four Singles into a single Observable, without any transformation.

        You can combine items emitted by multiple Singles so that they appear as a single Observable, by using the merge method.

        Scheduler:
        merge does not operate by default on a particular Scheduler.
        Parameters:
        t1 - a Single to be merged
        t2 - a Single to be merged
        t3 - a Single to be merged
        t4 - a Single to be merged
        Returns:
        an Observable that emits all of the items emitted by the source Singles
        See Also:
        ReactiveX operators documentation: Merge
      • merge

        public static final <T> Observable<T> merge(Single<? extends T> t1,
                                                    Single<? extends T> t2,
                                                    Single<? extends T> t3,
                                                    Single<? extends T> t4,
                                                    Single<? extends T> t5)
        Flattens five Singles into a single Observable, without any transformation.

        You can combine items emitted by multiple Singles so that they appear as a single Observable, by using the merge method.

        Scheduler:
        merge does not operate by default on a particular Scheduler.
        Parameters:
        t1 - a Single to be merged
        t2 - a Single to be merged
        t3 - a Single to be merged
        t4 - a Single to be merged
        t5 - a Single to be merged
        Returns:
        an Observable that emits all of the items emitted by the source Singles
        See Also:
        ReactiveX operators documentation: Merge
      • merge

        public static final <T> Observable<T> merge(Single<? extends T> t1,
                                                    Single<? extends T> t2,
                                                    Single<? extends T> t3,
                                                    Single<? extends T> t4,
                                                    Single<? extends T> t5,
                                                    Single<? extends T> t6)
        Flattens six Singles into a single Observable, without any transformation.

        You can combine items emitted by multiple Singles so that they appear as a single Observable, by using the merge method.

        Scheduler:
        merge does not operate by default on a particular Scheduler.
        Parameters:
        t1 - a Single to be merged
        t2 - a Single to be merged
        t3 - a Single to be merged
        t4 - a Single to be merged
        t5 - a Single to be merged
        t6 - a Single to be merged
        Returns:
        an Observable that emits all of the items emitted by the source Singles
        See Also:
        ReactiveX operators documentation: Merge
      • merge

        public static final <T> Observable<T> merge(Single<? extends T> t1,
                                                    Single<? extends T> t2,
                                                    Single<? extends T> t3,
                                                    Single<? extends T> t4,
                                                    Single<? extends T> t5,
                                                    Single<? extends T> t6,
                                                    Single<? extends T> t7)
        Flattens seven Singles into a single Observable, without any transformation.

        You can combine items emitted by multiple Singles so that they appear as a single Observable, by using the merge method.

        Scheduler:
        merge does not operate by default on a particular Scheduler.
        Parameters:
        t1 - a Single to be merged
        t2 - a Single to be merged
        t3 - a Single to be merged
        t4 - a Single to be merged
        t5 - a Single to be merged
        t6 - a Single to be merged
        t7 - a Single to be merged
        Returns:
        an Observable that emits all of the items emitted by the source Singles
        See Also:
        ReactiveX operators documentation: Merge
      • merge

        public static final <T> Observable<T> merge(Single<? extends T> t1,
                                                    Single<? extends T> t2,
                                                    Single<? extends T> t3,
                                                    Single<? extends T> t4,
                                                    Single<? extends T> t5,
                                                    Single<? extends T> t6,
                                                    Single<? extends T> t7,
                                                    Single<? extends T> t8)
        Flattens eight Singles into a single Observable, without any transformation.

        You can combine items emitted by multiple Singles so that they appear as a single Observable, by using the merge method.

        Scheduler:
        merge does not operate by default on a particular Scheduler.
        Parameters:
        t1 - a Single to be merged
        t2 - a Single to be merged
        t3 - a Single to be merged
        t4 - a Single to be merged
        t5 - a Single to be merged
        t6 - a Single to be merged
        t7 - a Single to be merged
        t8 - a Single to be merged
        Returns:
        an Observable that emits all of the items emitted by the source Singles
        See Also:
        ReactiveX operators documentation: Merge
      • merge

        public static final <T> Observable<T> merge(Single<? extends T> t1,
                                                    Single<? extends T> t2,
                                                    Single<? extends T> t3,
                                                    Single<? extends T> t4,
                                                    Single<? extends T> t5,
                                                    Single<? extends T> t6,
                                                    Single<? extends T> t7,
                                                    Single<? extends T> t8,
                                                    Single<? extends T> t9)
        Flattens nine Singles into a single Observable, without any transformation.

        You can combine items emitted by multiple Singles so that they appear as a single Observable, by using the merge method.

        Scheduler:
        merge does not operate by default on a particular Scheduler.
        Parameters:
        t1 - a Single to be merged
        t2 - a Single to be merged
        t3 - a Single to be merged
        t4 - a Single to be merged
        t5 - a Single to be merged
        t6 - a Single to be merged
        t7 - a Single to be merged
        t8 - a Single to be merged
        t9 - a Single to be merged
        Returns:
        an Observable that emits all of the items emitted by the source Singles
        See Also:
        ReactiveX operators documentation: Merge
      • zip

        public static final <T1,T2,R> Single<R> zip(Single<? extends T1> o1,
                                                    Single<? extends T2> o2,
                                                    Func2<? super T1,? super T2,? extends R> zipFunction)
        Returns a Single that emits the results of a specified combiner function applied to two items emitted by two other Singles.

        Scheduler:
        zip does not operate by default on a particular Scheduler.
        Parameters:
        o1 - the first source Single
        o2 - a second source Single
        zipFunction - a function that, when applied to the item emitted by each of the source Singles, results in an item that will be emitted by the resulting Single
        Returns:
        a Single that emits the zipped results
        See Also:
        ReactiveX operators documentation: Zip
      • zip

        public static final <T1,T2,T3,R> Single<R> zip(Single<? extends T1> o1,
                                                       Single<? extends T2> o2,
                                                       Single<? extends T3> o3,
                                                       Func3<? super T1,? super T2,? super T3,? extends R> zipFunction)
        Returns a Single that emits the results of a specified combiner function applied to three items emitted by three other Singles.

        Scheduler:
        zip does not operate by default on a particular Scheduler.
        Parameters:
        o1 - the first source Single
        o2 - a second source Single
        o3 - a third source Single
        zipFunction - a function that, when applied to the item emitted by each of the source Singles, results in an item that will be emitted by the resulting Single
        Returns:
        a Single that emits the zipped results
        See Also:
        ReactiveX operators documentation: Zip
      • zip

        public static final <T1,T2,T3,T4,R> Single<R> zip(Single<? extends T1> o1,
                                                          Single<? extends T2> o2,
                                                          Single<? extends T3> o3,
                                                          Single<? extends T4> o4,
                                                          Func4<? super T1,? super T2,? super T3,? super T4,? extends R> zipFunction)
        Returns an Observable that emits the results of a specified combiner function applied to four items emitted by four other Singles.

        Scheduler:
        zip does not operate by default on a particular Scheduler.
        Parameters:
        o1 - the first source Single
        o2 - a second source Single
        o3 - a third source Single
        o4 - a fourth source Single
        zipFunction - a function that, when applied to the item emitted by each of the source Singles, results in an item that will be emitted by the resulting Single
        Returns:
        a Single that emits the zipped results
        See Also:
        ReactiveX operators documentation: Zip
      • zip

        public static final <T1,T2,T3,T4,T5,R> Single<R> zip(Single<? extends T1> o1,
                                                             Single<? extends T2> o2,
                                                             Single<? extends T3> o3,
                                                             Single<? extends T4> o4,
                                                             Single<? extends T5> o5,
                                                             Func5<? super T1,? super T2,? super T3,? super T4,? super T5,? extends R> zipFunction)
        Returns an Observable that emits the results of a specified combiner function applied to five items emitted by five other Singles.

        Scheduler:
        zip does not operate by default on a particular Scheduler.
        Parameters:
        o1 - the first source Single
        o2 - a second source Single
        o3 - a third source Single
        o4 - a fourth source Single
        o5 - a fifth source Single
        zipFunction - a function that, when applied to the item emitted by each of the source Singles, results in an item that will be emitted by the resulting Single
        Returns:
        a Single that emits the zipped results
        See Also:
        ReactiveX operators documentation: Zip
      • zip

        public static final <T1,T2,T3,T4,T5,T6,R> Single<R> zip(Single<? extends T1> o1,
                                                                Single<? extends T2> o2,
                                                                Single<? extends T3> o3,
                                                                Single<? extends T4> o4,
                                                                Single<? extends T5> o5,
                                                                Single<? extends T6> o6,
                                                                Func6<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? extends R> zipFunction)
        Returns an Observable that emits the results of a specified combiner function applied to six items emitted by six other Singles.

        Scheduler:
        zip does not operate by default on a particular Scheduler.
        Parameters:
        o1 - the first source Single
        o2 - a second source Single
        o3 - a third source Single
        o4 - a fourth source Single
        o5 - a fifth source Single
        o6 - a sixth source Single
        zipFunction - a function that, when applied to the item emitted by each of the source Singles, results in an item that will be emitted by the resulting Single
        Returns:
        a Single that emits the zipped results
        See Also:
        ReactiveX operators documentation: Zip
      • zip

        public static final <T1,T2,T3,T4,T5,T6,T7,R> Single<R> zip(Single<? extends T1> o1,
                                                                   Single<? extends T2> o2,
                                                                   Single<? extends T3> o3,
                                                                   Single<? extends T4> o4,
                                                                   Single<? extends T5> o5,
                                                                   Single<? extends T6> o6,
                                                                   Single<? extends T7> o7,
                                                                   Func7<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? extends R> zipFunction)
        Returns an Observable that emits the results of a specified combiner function applied to seven items emitted by seven other Singles.

        Scheduler:
        zip does not operate by default on a particular Scheduler.
        Parameters:
        o1 - the first source Single
        o2 - a second source Single
        o3 - a third source Single
        o4 - a fourth source Single
        o5 - a fifth source Single
        o6 - a sixth source Single
        o7 - a seventh source Single
        zipFunction - a function that, when applied to the item emitted by each of the source Singles, results in an item that will be emitted by the resulting Single
        Returns:
        a Single that emits the zipped results
        See Also:
        ReactiveX operators documentation: Zip
      • zip

        public static final <T1,T2,T3,T4,T5,T6,T7,T8,R> Single<R> zip(Single<? extends T1> o1,
                                                                      Single<? extends T2> o2,
                                                                      Single<? extends T3> o3,
                                                                      Single<? extends T4> o4,
                                                                      Single<? extends T5> o5,
                                                                      Single<? extends T6> o6,
                                                                      Single<? extends T7> o7,
                                                                      Single<? extends T8> o8,
                                                                      Func8<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? super T8,? extends R> zipFunction)
        Returns an Observable that emits the results of a specified combiner function applied to eight items emitted by eight other Singles.

        Scheduler:
        zip does not operate by default on a particular Scheduler.
        Parameters:
        o1 - the first source Single
        o2 - a second source Single
        o3 - a third source Single
        o4 - a fourth source Single
        o5 - a fifth source Single
        o6 - a sixth source Single
        o7 - a seventh source Single
        o8 - an eighth source Single
        zipFunction - a function that, when applied to the item emitted by each of the source Singles, results in an item that will be emitted by the resulting Single
        Returns:
        a Single that emits the zipped results
        See Also:
        ReactiveX operators documentation: Zip
      • zip

        public static final <T1,T2,T3,T4,T5,T6,T7,T8,T9,R> Single<R> zip(Single<? extends T1> o1,
                                                                         Single<? extends T2> o2,
                                                                         Single<? extends T3> o3,
                                                                         Single<? extends T4> o4,
                                                                         Single<? extends T5> o5,
                                                                         Single<? extends T6> o6,
                                                                         Single<? extends T7> o7,
                                                                         Single<? extends T8> o8,
                                                                         Single<? extends T9> o9,
                                                                         Func9<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? super T8,? super T9,? extends R> zipFunction)
        Returns an Observable that emits the results of a specified combiner function applied to nine items emitted by nine other Singles.

        Scheduler:
        zip does not operate by default on a particular Scheduler.
        Parameters:
        o1 - the first source Single
        o2 - a second source Single
        o3 - a third source Single
        o4 - a fourth source Single
        o5 - a fifth source Single
        o6 - a sixth source Single
        o7 - a seventh source Single
        o8 - an eighth source Single
        o9 - a ninth source Single
        zipFunction - a function that, when applied to the item emitted by each of the source Singles, results in an item that will be emitted by the resulting Single
        Returns:
        a Single that emits the zipped results
        See Also:
        ReactiveX operators documentation: Zip
      • concatWith

        public final Observable<T> concatWith(Single<? extends T> t1)
        Returns an Observable that emits the item emitted by the source Single, then the item emitted by the specified Single.

        Scheduler:
        concat does not operate by default on a particular Scheduler.
        Parameters:
        t1 - a Single to be concatenated after the current
        Returns:
        an Observable that emits the item emitted by the source Single, followed by the item emitted by t1
        See Also:
        ReactiveX operators documentation: Concat
      • flatMap

        public final <R> Single<R> flatMap(Func1<? super T,? extends Single<? extends R>> func)
        Returns a Single that is based on applying a specified function to the item emitted by the source Single, where that function returns a Single.

        Scheduler:
        flatMap does not operate by default on a particular Scheduler.
        Parameters:
        func - a function that, when applied to the item emitted by the source Single, returns a Single
        Returns:
        the Single returned from func when applied to the item emitted by the source Single
        See Also:
        ReactiveX operators documentation: FlatMap
      • flatMapObservable

        public final <R> Observable<R> flatMapObservable(Func1<? super T,? extends Observable<? extends R>> func)
        Returns an Observable that emits items based on applying a specified function to the item emitted by the source Observable, where that function returns an Observable.

        Scheduler:
        flatMapObservable does not operate by default on a particular Scheduler.
        Parameters:
        func - a function that, when applied to the item emitted by the source Single, returns an Observable
        Returns:
        the Observable returned from func when applied to the item emitted by the source Single
        See Also:
        ReactiveX operators documentation: FlatMap
      • map

        public final <R> Single<R> map(Func1<? super T,? extends R> func)
        Returns a Single that applies a specified function to the item emitted by the source Single and emits the result of this function application.

        Scheduler:
        map does not operate by default on a particular Scheduler.
        Parameters:
        func - a function to apply to the item emitted by the Single
        Returns:
        a Single that emits the item from the source Single, transformed by the specified function
        See Also:
        ReactiveX operators documentation: Map
      • mergeWith

        public final Observable<T> mergeWith(Single<? extends T> t1)
        Flattens this and another Single into a single Observable, without any transformation.

        You can combine items emitted by multiple Singles so that they appear as a single Observable, by using the mergeWith method.

        Scheduler:
        mergeWith does not operate by default on a particular Scheduler.
        Parameters:
        t1 - a Single to be merged
        Returns:
        an Observable that emits all of the items emitted by the source Singles
        See Also:
        ReactiveX operators documentation: Merge
      • onErrorReturn

        public final Single<T> onErrorReturn(Func1<Throwable,? extends T> resumeFunction)
        Instructs a Single to emit an item (returned by a specified function) rather than invoking onError if it encounters an error.

        By default, when a Single encounters an error that prevents it from emitting the expected item to its subscriber, the Single invokes its subscriber's Observer.onError(java.lang.Throwable) method, and then quits without invoking any more of its subscriber's methods. The onErrorReturn method changes this behavior. If you pass a function (resumeFunction) to a Single's onErrorReturn method, if the original Single encounters an error, instead of invoking its subscriber's Observer.onError(java.lang.Throwable) method, it will instead emit the return value of resumeFunction.

        You can use this to prevent errors from propagating or to supply fallback data should errors be encountered.

        Scheduler:
        onErrorReturn does not operate by default on a particular Scheduler.
        Parameters:
        resumeFunction - a function that returns an item that the new Single will emit if the source Single encounters an error
        Returns:
        the original Single with appropriately modified behavior
        See Also:
        ReactiveX operators documentation: Catch
      • subscribe

        public final Subscription subscribe(Action1<? super T> onSuccess,
                                            Action1<Throwable> onError)
        Subscribes to a Single and provides callbacks to handle the item it emits or any error notification it issues.
        Scheduler:
        subscribe does not operate by default on a particular Scheduler.
        Parameters:
        onSuccess - the Action1<T> you have designed to accept the emission from the Single
        onError - the Action1<Throwable> you have designed to accept any error notification from the Single
        Returns:
        a Subscription reference can request the Single stop work.
        Throws:
        IllegalArgumentException - if onNext is null, or if onError is null
        See Also:
        ReactiveX operators documentation: Subscribe
      • unsafeSubscribe

        public final void unsafeSubscribe(Subscriber<? super T> subscriber)
        Subscribes to a Single and invokes the Single.OnSubscribe function without any contract protection, error handling, unsubscribe, or execution hooks.

        Use this only for implementing an Observable.Operator that requires nested subscriptions. For other purposes, use subscribe(Subscriber) which ensures the Rx contract and other functionality.

        Scheduler:
        unsafeSubscribe does not operate by default on a particular Scheduler.
        Parameters:
        subscriber - the Subscriber that will handle the emission or notification from the Single
      • subscribe

        public final Subscription subscribe(Subscriber<? super T> subscriber)
        Subscribes to a Single and provides a Subscriber that implements functions to handle the item the Single emits or any error notification it issues.

        A typical implementation of subscribe does the following:

        1. It stores a reference to the Subscriber in a collection object, such as a List<T> object.
        2. It returns a reference to the Subscription interface. This enables Subscribers to unsubscribe, that is, to stop receiving the item or notification before the Single completes.

        A Single<T> instance is responsible for accepting all subscriptions and notifying all Subscribers. Unless the documentation for a particular Single<T> implementation indicates otherwise, Subscribers should make no assumptions about the order in which multiple Subscribers will receive their notifications.

        For more information see the ReactiveX documentation.

        Scheduler:
        subscribe does not operate by default on a particular Scheduler.
        Parameters:
        subscriber - the Subscriber that will handle the emission or notification from the Single
        Returns:
        a Subscription reference can request the Single stop work.
        Throws:
        IllegalStateException - if subscribe is unable to obtain an OnSubscribe<> function
        IllegalArgumentException - if the Subscriber provided as the argument to subscribe is null
        OnErrorNotImplementedException - if the Subscriber's onError method is null
        RuntimeException - if the Subscriber's onError method itself threw a Throwable
        See Also:
        ReactiveX operators documentation: Subscribe
      • subscribe

        public final Subscription subscribe(SingleSubscriber<? super T> te)
        Subscribes to a Single and provides a SingleSubscriber that implements functions to handle the item the Single emits or any error notification it issues.

        A typical implementation of subscribe does the following:

        1. It stores a reference to the Subscriber in a collection object, such as a List<T> object.
        2. It returns a reference to the Subscription interface. This enables Subscribers to unsubscribe, that is, to stop receiving the item or notification before the Single completes.

        A Single<T> instance is responsible for accepting all subscriptions and notifying all Subscribers. Unless the documentation for a particular Single<T> implementation indicates otherwise, Subscribers should make no assumptions about the order in which multiple Subscribers will receive their notifications.

        For more information see the ReactiveX documentation.

        Scheduler:
        subscribe does not operate by default on a particular Scheduler.
        Parameters:
        te - the SingleSubscriber that will handle the emission or notification from the Single
        Returns:
        a Subscription reference can request the Single stop work.
        Throws:
        IllegalStateException - if subscribe is unable to obtain an OnSubscribe<> function
        IllegalArgumentException - if the SingleSubscriber provided as the argument to subscribe is null
        OnErrorNotImplementedException - if the SingleSubscriber's onError method is null
        RuntimeException - if the SingleSubscriber's onError method itself threw a Throwable
        See Also:
        ReactiveX operators documentation: Subscribe
      • timeout

        public final Single<T> timeout(long timeout,
                                       TimeUnit timeUnit)
        Returns a Single that mirrors the source Single but applies a timeout policy for its emitted item. If it is not emitted within the specified timeout duration, the resulting Single terminates and notifies subscribers of a TimeoutException.

        Scheduler:
        This version of timeout operates by default on the computation Scheduler.
        Parameters:
        timeout - maximum duration before the Single times out
        timeUnit - the unit of time that applies to the timeout argument.
        Returns:
        the source Single modified to notify subscribers of a TimeoutException in case of a timeout
        See Also:
        ReactiveX operators documentation: Timeout
      • timeout

        public final Single<T> timeout(long timeout,
                                       TimeUnit timeUnit,
                                       Scheduler scheduler)
        Returns a Single that mirrors the source Single but applies a timeout policy for its emitted item, where this policy is governed on a specified Scheduler. If the item is not emitted within the specified timeout duration, the resulting Single terminates and notifies subscribers of a TimeoutException.

        Scheduler:
        you specify which Scheduler this operator will use
        Parameters:
        timeout - maximum duration before the Single times out
        timeUnit - the unit of time that applies to the timeout argument
        scheduler - the Scheduler to run the timeout timers on
        Returns:
        the source Single modified to notify subscribers of a TimeoutException in case of a timeout
        See Also:
        ReactiveX operators documentation: Timeout
      • timeout

        public final Single<T> timeout(long timeout,
                                       TimeUnit timeUnit,
                                       Single<? extends T> other)
        Returns a Single that mirrors the source Single but applies a timeout policy for its emitted item. If it is not emitted within the specified timeout duration, the resulting Single instead mirrors a fallback Single.

        Scheduler:
        This version of timeout operates by default on the computation Scheduler.
        Parameters:
        timeout - maximum time before a timeout occurs
        timeUnit - the unit of time that applies to the timeout argument
        other - the fallback Single to use in case of a timeout
        Returns:
        the source Single modified to switch to the fallback Single in case of a timeout
        See Also:
        ReactiveX operators documentation: Timeout
      • timeout

        public final Single<T> timeout(long timeout,
                                       TimeUnit timeUnit,
                                       Single<? extends T> other,
                                       Scheduler scheduler)
        Returns a Single that mirrors the source Single but applies a timeout policy for its emitted item, using a specified Scheduler. If the item isn't emitted within the specified timeout duration, the resulting Single instead mirrors a fallback Single.

        Scheduler:
        you specify which Scheduler this operator will use
        Parameters:
        timeout - maximum duration before a timeout occurs
        timeUnit - the unit of time that applies to the timeout argument
        other - the Single to use as the fallback in case of a timeout
        scheduler - the Scheduler to run the timeout timers on
        Returns:
        the source Single modified so that it will switch to the fallback Singlein case of a timeout
        See Also:
        ReactiveX operators documentation: Timeout
      • zipWith

        public final <T2,R> Single<R> zipWith(Single<? extends T2> other,
                                              Func2<? super T,? super T2,? extends R> zipFunction)
        Returns a Single that emits the result of applying a specified function to the pair of items emitted by the source Single and another specified Single.

        Scheduler:
        zipWith does not operate by default on a particular Scheduler.
        Type Parameters:
        T2 - the type of items emitted by the other Single
        R - the type of items emitted by the resulting Single
        Parameters:
        other - the other Observable
        zipFunction - a function that combines the pairs of items from the two Observables to generate the items to be emitted by the resulting Single
        Returns:
        an Observable that pairs up values from the source Observable and the other Observable and emits the results of zipFunction applied to these pairs
        See Also:
        ReactiveX operators documentation: Zip
      • doOnError

        @Experimental
        public final Single<T> doOnError(Action1<Throwable> onError)
        Modifies the source Single so that it invokes an action if it calls onError.

        In case the onError action throws, the downstream will receive a composite exception containing the original exception and the exception thrown by onError.

        Scheduler:
        doOnError does not operate by default on a particular Scheduler.
        Parameters:
        onError - the action to invoke if the source Single calls onError
        Returns:
        the source Single with the side-effecting behavior applied
        See Also:
        ReactiveX operators documentation: Do
      • delay

        @Experimental
        public final Single<T> delay(long delay,
                                                   TimeUnit unit,
                                                   Scheduler scheduler)
        Returns an Single that emits the items emitted by the source Single shifted forward in time by a specified delay. Error notifications from the source Single are not delayed.

        Scheduler:
        you specify which Scheduler this operator will use
        Parameters:
        delay - the delay to shift the source by
        unit - the time unit of delay
        scheduler - the Scheduler to use for delaying
        Returns:
        the source Single shifted in time by the specified delay
        See Also:
        ReactiveX operators documentation: Delay
      • delay

        @Experimental
        public final Single<T> delay(long delay,
                                                   TimeUnit unit)
        Returns an Single that emits the items emitted by the source Single shifted forward in time by a specified delay. Error notifications from the source Observable are not delayed.

        Scheduler:
        This version of delay operates by default on the compuation Scheduler.
        Parameters:
        delay - the delay to shift the source by
        unit - the TimeUnit in which period is defined
        Returns:
        the source Single shifted in time by the specified delay
        See Also:
        ReactiveX operators documentation: Delay
      • defer

        @Experimental
        public static <T> Single<T> defer(Callable<Single<T>> singleFactory)
        Returns a Single that calls a Single factory to create a Single for each new Observer that subscribes. That is, for each subscriber, the actual Single that subscriber observes is determined by the factory function.

        The defer Observer allows you to defer or delay emitting value from a Single until such time as an Observer subscribes to the Single. This allows an Observer to easily obtain updates or a refreshed version of the sequence.

        Scheduler:
        defer does not operate by default on a particular Scheduler.
        Type Parameters:
        T - the type of the items emitted by the Single.
        Parameters:
        singleFactory - the Single factory function to invoke for each Observer that subscribes to the resulting Single.
        Returns:
        a Single whose Observers' subscriptions trigger an invocation of the given Single factory function.
        See Also:
        ReactiveX operators documentation: Defer