public final class SingleCache<T> extends Single<T> implements SingleObserver<T>
Constructor and Description |
---|
SingleCache(SingleSource<? extends T> source) |
Modifier and Type | Method and Description |
---|---|
void |
onError(Throwable e)
Notifies the SingleObserver that the
Single has experienced an error condition. |
void |
onSubscribe(Disposable d)
Provides the SingleObserver with the means of cancelling (disposing) the
connection (channel) with the Single in both
synchronous (from within
onSubscribe(Disposable) itself) and asynchronous manner. |
void |
onSuccess(T value)
Notifies the SingleObserver with a single item and that the
Single has finished sending
push-based notifications. |
protected void |
subscribeActual(SingleObserver<? super T> observer)
Implement this method in subclasses to handle the incoming
SingleObserver s. |
amb, ambArray, ambWith, as, blockingGet, cache, cast, compose, concat, concat, concat, concat, concat, concat, concat, concatArray, concatArrayEager, concatEager, concatEager, concatWith, contains, contains, create, defer, delay, delay, delay, delay, delaySubscription, delaySubscription, delaySubscription, delaySubscription, delaySubscription, delaySubscription, dematerialize, doAfterSuccess, doAfterTerminate, doFinally, doOnDispose, doOnError, doOnEvent, doOnSubscribe, doOnSuccess, equals, error, error, filter, flatMap, flatMapCompletable, flatMapMaybe, flatMapObservable, flatMapPublisher, flattenAsFlowable, flattenAsObservable, fromCallable, fromFuture, fromFuture, fromFuture, fromFuture, fromObservable, fromPublisher, hide, ignoreElement, just, lift, map, materialize, merge, merge, merge, merge, merge, merge, mergeDelayError, mergeDelayError, mergeDelayError, mergeDelayError, mergeDelayError, mergeWith, never, observeOn, onErrorResumeNext, onErrorResumeNext, onErrorReturn, onErrorReturnItem, onTerminateDetach, repeat, repeat, repeatUntil, repeatWhen, retry, retry, retry, retry, retry, retryWhen, subscribe, subscribe, subscribe, subscribe, subscribe, subscribeOn, subscribeWith, takeUntil, takeUntil, takeUntil, test, test, timeout, timeout, timeout, timeout, timer, timer, to, toCompletable, toFlowable, toFuture, toMaybe, toObservable, unsafeCreate, unsubscribeOn, using, using, wrap, zip, zip, zip, zip, zip, zip, zip, zip, zip, zipArray, zipWith
public SingleCache(SingleSource<? extends T> source)
protected void subscribeActual(SingleObserver<? super T> observer)
Single
SingleObserver
s.
There is no need to call any of the plugin hooks on the current Single
instance or
the SingleObserver
; all hooks and basic safeguards have been
applied by Single.subscribe(SingleObserver)
before this method gets called.
subscribeActual
in class Single<T>
observer
- the SingleObserver to handle, not nullpublic void onSubscribe(Disposable d)
SingleObserver
onSubscribe(Disposable)
itself) and asynchronous manner.onSubscribe
in interface SingleObserver<T>
d
- the Disposable instance whose Disposable.dispose()
can
be called anytime to cancel the connectionpublic void onSuccess(T value)
SingleObserver
Single
has finished sending
push-based notifications.
The Single
will not call this method if it calls SingleObserver.onError(java.lang.Throwable)
.
onSuccess
in interface SingleObserver<T>
value
- the item emitted by the Singlepublic void onError(Throwable e)
SingleObserver
Single
has experienced an error condition.
If the Single
calls this method, it will not thereafter call SingleObserver.onSuccess(T)
.
onError
in interface SingleObserver<T>
e
- the exception encountered by the SingleCopyright © 2019. All rights reserved.