Uses of Class
rx.Single
Packages that use Single
Package
Description
Base reactive classes: Observable, Single and Completable; base reactive consumers;
other common base interfaces.
Operators that allow composing Observables to transform and
manipulate data in an asynchronous, functional and thread-safe manner.
Callback types and a central plugin handler class to hook into the lifecycle
of the base reactive types and schedulers.
Classes extending the Single base reactive class.
-
Uses of Single in rx
Modifier and TypeMethodDescriptionfinal <T> Single
<T> Returns a Single which will subscribe to this Completable and once that is completed then will subscribe to thenext
Single.<R> Single
<R> Single.compose
(Single.Transformer<? super T, ? extends R> transformer) Transform a Single by applying a particular Transformer function to it.static <T> Single
<T> Single.create
(Single.OnSubscribe<T> f) Returns a Single that will execute the specified function when aSingleSubscriber
executes it or aSubscriber
subscribes to it.static <T> Single
<T> Returns an Single that emits the items emitted by the source Single shifted forward in time by a specified delay.Returns an Single that emits the items emitted by the source Single shifted forward in time by a specified delay.Single.delaySubscription
(Observable<?> other) Returns a Single that delays the subscription to this Single until the Observable completes.Single.doAfterTerminate
(Action0 action) Registers anAction0
to be called when thisSingle
invokes eitherSingleSubscriber.onSuccess(Object)
onSuccess} oronError
.Modifies the sourceSingle
so that it invokes an action if it callsonError
.Single.doOnSubscribe
(Action0 subscribe) Modifies the sourceSingle
so that it invokes the given action when it is subscribed from its subscribers.Single.doOnSuccess
(Action1<? super T> onSuccess) Modifies the sourceSingle
so that it invokes an action when it callsonSuccess
.Single.doOnUnsubscribe
(Action0 action) Modifies the sourceSingle
so that it invokes the given action when it is unsubscribed from its subscribers.static <T> Single
<T> Returns a Single that invokes a subscriber'sonError
method when the subscriber subscribes to it.final <R> Single
<R> 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.static <T> Single
<T> Converts aFuture
into aSingle
.static <T> Single
<T> Converts aFuture
into aSingle
, with a timeout on the Future.static <T> Single
<T> static <T> Single
<T> Single.fromCallable
(Callable<? extends T> func) Returns aSingle
that invokes passed function and emits its result for each new Observer that subscribes.(package private) static <T> Single<? extends T>[]
Single.iterableToArray
(Iterable<? extends Single<? extends T>> singlesIterable) FOR INTERNAL USE ONLY.static <T> Single
<T> Single.just
(T value) Returns aSingle
that emits a specified item.final <R> Single
<R> Single.lift
(Observable.Operator<? extends R, ? super T> lift) Lifts a function to the current Single and returns a new Single that when subscribed to will pass the values of the current Single through the Operator function.final <R> Single
<R> 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> Flattens aSingle
that emits aSingle
into a singleSingle
that emits the item emitted by the nestedSingle
, without any transformation.private Single
<Observable<T>> Single.nest()
INTERNAL: Used with lift and operators.Modifies a Single to emit its item (or notify of its error) on a specifiedScheduler
, asynchronously.Single.onErrorResumeNext
(Func1<Throwable, ? extends Single<? extends T>> resumeFunctionInCaseOfError) Instructs a Single to pass control to another Single rather than invokingObserver.onError(Throwable)
if it encounters an error.Single.onErrorResumeNext
(Single<? extends T> resumeSingleInCaseOfError) Instructs a Single to pass control to another Single rather than invokingObserver.onError(Throwable)
if it encounters an error.Single.onErrorReturn
(Func1<Throwable, ? extends T> resumeFunction) Instructs a Single to emit an item (returned by a specified function) rather than invokingonError
if it encounters an error.Single.retry()
Returns a Single that mirrors the source Single, resubscribing to it if it callsonError
(infinite retry count).Single.retry
(long count) Returns an Single that mirrors the source Single, resubscribing to it if it callsonError
up to a specified number of retries.Returns an Single that mirrors the source Single, resubscribing to it if it callsonError
and the predicate returns true for that specific exception and retry count.Single.retryWhen
(Func1<Observable<? extends Throwable>, ? extends Observable<?>> notificationHandler) Returns a Single that emits the same values as the source Single with the exception of anonError
.Single.subscribeOn
(Scheduler scheduler) Asynchronously subscribes subscribers to this Single on the specifiedScheduler
.Single.takeUntil
(Completable other) Returns a Single that emits the item emitted by the source Single until a Completable terminates.Single.takeUntil
(Observable<? extends E> other) Returns a Single that emits the item emitted by the source Single until an Observable emits an item.Returns a Single that emits the item emitted by the source Single until a second Single emits an item.Returns a Single that mirrors the source Single but applies a timeout policy for its emitted item.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.Returns a Single that mirrors the source Single but applies a timeout policy for its emitted item.Returns a Single that mirrors the source Single but applies a timeout policy for its emitted item, using a specified Scheduler.final <T> Single
<T> Converts this Completable into a Single which when this Completable completes normally, calls the given supplier and emits its returned value through onSuccess.Observable.toSingle()
Returns a Single that emits the single item emitted by the source Observable, if that Observable emits only a single item.final <T> Single
<T> Completable.toSingleDefault
(T completionValue) Converts this Completable into a Single which when this Completable completes normally, emits the given value through onSuccess.static <T,
Resource>
Single<T> Single.using
(Func0<Resource> resourceFactory, Func1<? super Resource, ? extends Single<? extends T>> singleFactory, Action1<? super Resource> disposeAction) Constructs an Single that creates a dependent resource object which is disposed of on unsubscription.static <T,
Resource>
Single<T> Single.using
(Func0<Resource> resourceFactory, Func1<? super Resource, ? extends Single<? extends T>> singleFactory, Action1<? super Resource> disposeAction, boolean disposeEagerly) Constructs an Single that creates a dependent resource object which is disposed of just before termination if you have setdisposeEagerly
totrue
and unsubscription does not occur before termination.static <R> Single
<R> Returns a Single that emits the result of specified combiner function applied to combination of items emitted, in sequence, by an Iterable of other Singles.static <T1,
T2, R>
Single<R> Single.zip
(Single<? extends T1> s1, Single<? extends T2> s2, 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> Single.zip
(Single<? extends T1> s1, Single<? extends T2> s2, Single<? extends T3> s3, 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> Single.zip
(Single<? extends T1> s1, Single<? extends T2> s2, Single<? extends T3> s3, Single<? extends T4> s4, 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> Single.zip
(Single<? extends T1> s1, Single<? extends T2> s2, Single<? extends T3> s3, Single<? extends T4> s4, Single<? extends T5> s5, 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> Single.zip
(Single<? extends T1> s1, Single<? extends T2> s2, Single<? extends T3> s3, Single<? extends T4> s4, Single<? extends T5> s5, Single<? extends T6> s6, 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> Single.zip
(Single<? extends T1> s1, Single<? extends T2> s2, Single<? extends T3> s3, Single<? extends T4> s4, Single<? extends T5> s5, Single<? extends T6> s6, Single<? extends T7> s7, 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> Single.zip
(Single<? extends T1> s1, Single<? extends T2> s2, Single<? extends T3> s3, Single<? extends T4> s4, Single<? extends T5> s5, Single<? extends T6> s6, Single<? extends T7> s7, Single<? extends T8> s8, 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> Single.zip
(Single<? extends T1> s1, Single<? extends T2> s2, Single<? extends T3> s3, Single<? extends T4> s4, Single<? extends T5> s5, Single<? extends T6> s6, Single<? extends T7> s7, Single<? extends T8> s8, Single<? extends T9> s9, 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.final <T2,
R> Single <R> 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.Modifier and TypeMethodDescriptionfinal <T> Single
<T> Returns a Single which will subscribe to this Completable and once that is completed then will subscribe to thenext
Single.private static <T> Observable
<T> Single.asObservable
(Single<T> t) static <T> Observable
<T> Returns an Observable that emits the items emitted by two Singles, one after the other.static <T> Observable
<T> Returns an Observable that emits the items emitted by three Singles, one after the other.static <T> Observable
<T> Single.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> Single.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> Single.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> Single.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> Single.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> Single.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.final Observable
<T> Single.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 Completable
Completable.fromSingle
(Single<?> single) Returns a Completable instance that when subscribed to, subscribes to the Single instance and emits a completion event if the single emits onSuccess or forwards any onError events.static <T> Single
<T> Flattens aSingle
that emits aSingle
into a singleSingle
that emits the item emitted by the nestedSingle
, without any transformation.static <T> Observable
<T> Flattens two Singles into a single Observable, without any transformation.static <T> Observable
<T> Flattens three Singles into a single Observable, without any transformation.static <T> Observable
<T> Single.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> Single.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> Single.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> Single.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> Single.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> Single.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.final Observable
<T> Flattens this and another Single into a single Observable, without any transformation.Single.onErrorResumeNext
(Single<? extends T> resumeSingleInCaseOfError) Instructs a Single to pass control to another Single rather than invokingObserver.onError(Throwable)
if it encounters an error.Returns a Single that emits the item emitted by the source Single until a second Single emits an item.Returns a Single that mirrors the source Single but applies a timeout policy for its emitted item.Returns a Single that mirrors the source Single but applies a timeout policy for its emitted item, using a specified Scheduler.static <T1,
T2, R>
Single<R> Single.zip
(Single<? extends T1> s1, Single<? extends T2> s2, 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> Single.zip
(Single<? extends T1> s1, Single<? extends T2> s2, Single<? extends T3> s3, 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> Single.zip
(Single<? extends T1> s1, Single<? extends T2> s2, Single<? extends T3> s3, Single<? extends T4> s4, 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> Single.zip
(Single<? extends T1> s1, Single<? extends T2> s2, Single<? extends T3> s3, Single<? extends T4> s4, Single<? extends T5> s5, 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> Single.zip
(Single<? extends T1> s1, Single<? extends T2> s2, Single<? extends T3> s3, Single<? extends T4> s4, Single<? extends T5> s5, Single<? extends T6> s6, 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> Single.zip
(Single<? extends T1> s1, Single<? extends T2> s2, Single<? extends T3> s3, Single<? extends T4> s4, Single<? extends T5> s5, Single<? extends T6> s6, Single<? extends T7> s7, 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> Single.zip
(Single<? extends T1> s1, Single<? extends T2> s2, Single<? extends T3> s3, Single<? extends T4> s4, Single<? extends T5> s5, Single<? extends T6> s6, Single<? extends T7> s7, Single<? extends T8> s8, 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> Single.zip
(Single<? extends T1> s1, Single<? extends T2> s2, Single<? extends T3> s3, Single<? extends T4> s4, Single<? extends T5> s5, Single<? extends T6> s6, Single<? extends T7> s7, Single<? extends T8> s8, Single<? extends T9> s9, 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.final <T2,
R> Single <R> 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.Modifier and TypeMethodDescriptionstatic <T> Single
<T> final <R> Single
<R> 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.(package private) static <T> Single<? extends T>[]
Single.iterableToArray
(Iterable<? extends Single<? extends T>> singlesIterable) FOR INTERNAL USE ONLY.static <T> Single
<T> Flattens aSingle
that emits aSingle
into a singleSingle
that emits the item emitted by the nestedSingle
, without any transformation.Single.onErrorResumeNext
(Func1<Throwable, ? extends Single<? extends T>> resumeFunctionInCaseOfError) Instructs a Single to pass control to another Single rather than invokingObserver.onError(Throwable)
if it encounters an error.static <T,
Resource>
Single<T> Single.using
(Func0<Resource> resourceFactory, Func1<? super Resource, ? extends Single<? extends T>> singleFactory, Action1<? super Resource> disposeAction) Constructs an Single that creates a dependent resource object which is disposed of on unsubscription.static <T,
Resource>
Single<T> Single.using
(Func0<Resource> resourceFactory, Func1<? super Resource, ? extends Single<? extends T>> singleFactory, Action1<? super Resource> disposeAction, boolean disposeEagerly) Constructs an Single that creates a dependent resource object which is disposed of just before termination if you have setdisposeEagerly
totrue
and unsubscription does not occur before termination.static <R> Single
<R> Returns a Single that emits the result of specified combiner function applied to combination of items emitted, in sequence, by an Iterable of other Singles. -
Uses of Single in rx.internal.operators
Fields in rx.internal.operators declared as SingleModifier and TypeFieldDescriptionSingleOnSubscribeDelaySubscriptionOther.main
SingleOperatorOnErrorResumeNext.originalSingle
SingleDoAfterTerminate.source
SingleOnSubscribeMap.source
Fields in rx.internal.operators with type parameters of type SingleModifier and TypeFieldDescriptionSingleOperatorOnErrorResumeNext.resumeFunctionInCaseOfError
SingleOnSubscribeUsing.singleFactory
Methods in rx.internal.operators that return SingleMethods in rx.internal.operators with parameters of type SingleModifier and TypeMethodDescriptionstatic <T> SingleOperatorOnErrorResumeNext
<T> SingleOperatorOnErrorResumeNext.withFunction
(Single<? extends T> originalSingle, Func1<Throwable, ? extends Single<? extends T>> resumeFunctionInCaseOfError) static <T> SingleOperatorOnErrorResumeNext
<T> SingleOperatorOnErrorResumeNext.withOther
(Single<? extends T> originalSingle, Single<? extends T> resumeSingleInCaseOfError) static <T,
R> Single <R> Method parameters in rx.internal.operators with type arguments of type SingleModifier and TypeMethodDescriptionstatic <T> SingleOperatorOnErrorResumeNext
<T> SingleOperatorOnErrorResumeNext.withFunction
(Single<? extends T> originalSingle, Func1<Throwable, ? extends Single<? extends T>> resumeFunctionInCaseOfError) Constructors in rx.internal.operators with parameters of type SingleModifierConstructorDescriptionSingleDoAfterTerminate
(Single<T> source, Action0 action) SingleOnSubscribeDelaySubscriptionOther
(Single<? extends T> main, Observable<?> other) private
SingleOperatorOnErrorResumeNext
(Single<? extends T> originalSingle, Func1<Throwable, ? extends Single<? extends T>> resumeFunctionInCaseOfError) Constructor parameters in rx.internal.operators with type arguments of type SingleModifierConstructorDescriptionSingleOnSubscribeUsing
(Func0<Resource> resourceFactory, Func1<? super Resource, ? extends Single<? extends T>> observableFactory, Action1<? super Resource> disposeAction, boolean disposeEagerly) private
SingleOperatorOnErrorResumeNext
(Single<? extends T> originalSingle, Func1<Throwable, ? extends Single<? extends T>> resumeFunctionInCaseOfError) -
Uses of Single in rx.internal.util
Subclasses of Single in rx.internal.utilMethods in rx.internal.util that return SingleModifier and TypeMethodDescription<R> Single
<R> ScalarSynchronousSingle.scalarFlatMap
(Func1<? super T, ? extends Single<? extends R>> func) ScalarSynchronousSingle.scalarScheduleOn
(Scheduler scheduler) Customized observeOn/subscribeOn implementation which emits the scalar value directly or with less overhead on the specified scheduler.Method parameters in rx.internal.util with type arguments of type SingleModifier and TypeMethodDescription<R> Single
<R> ScalarSynchronousSingle.scalarFlatMap
(Func1<? super T, ? extends Single<? extends R>> func) -
Uses of Single in rx.plugins
Fields in rx.plugins with type parameters of type SingleModifier and TypeFieldDescription(package private) static Func2
<Single, Observable.OnSubscribe, Observable.OnSubscribe> RxJavaHooks.onSingleStart
Methods in rx.plugins that return types with arguments of type SingleModifier and TypeMethodDescriptionRxJavaHooks.getOnSingleStart()
Returns the current Single onStart hook function or null if it is set to the default pass-through.Methods in rx.plugins with parameters of type SingleModifier and TypeMethodDescriptionstatic <T> Observable.OnSubscribe
<T> RxJavaHooks.onSingleStart
(Single<T> instance, Observable.OnSubscribe<T> onSubscribe) Hook to call before the child subscriber is subscribed to the OnSubscribe action.<T> Observable.OnSubscribe
<T> RxJavaSingleExecutionHook.onSubscribeStart
(Single<? extends T> singleInstance, Observable.OnSubscribe<T> onSubscribe) Deprecated.Method parameters in rx.plugins with type arguments of type SingleModifier and TypeMethodDescriptionstatic void
RxJavaHooks.setOnSingleStart
(Func2<Single, Observable.OnSubscribe, Observable.OnSubscribe> onSingleStart) Sets the hook function that is called when a subscriber subscribes to a Single unless a lockdown is in effect. -
Uses of Single in rx.singles
Fields in rx.singles declared as SingleMethods in rx.singles with parameters of type SingleModifier and TypeMethodDescriptionstatic <T> BlockingSingle
<T> Converts aSingle
into aBlockingSingle
.Constructors in rx.singles with parameters of type Single