Class MaterializeSingleObserver<T>
java.lang.Object
io.reactivex.rxjava3.internal.operators.mixed.MaterializeSingleObserver<T>
- Type Parameters:
T- the element type of the source
- All Implemented Interfaces:
CompletableObserver, MaybeObserver<T>, SingleObserver<T>, Disposable
public final class MaterializeSingleObserver<T>
extends Object
implements SingleObserver<T>, MaybeObserver<T>, CompletableObserver, Disposable
A consumer that implements the consumer types of Maybe, Single and Completable
and turns their signals into Notifications for a SingleObserver.
History: 2.2.4 - experimental
- Since:
- 3.0.0
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final SingleObserver<? super Notification<T>> (package private) Disposable -
Constructor Summary
ConstructorsConstructorDescriptionMaterializeSingleObserver(SingleObserver<? super Notification<T>> downstream) -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Dispose the resource, the operation should be idempotent.booleanReturns true if this resource has been disposed.voidCalled once the deferred computation completes normally.voidNotifies theSingleObserverthat theSinglehas experienced an error condition.voidProvides theSingleObserverwith the means of cancelling (disposing) the connection (channel) with the Single in both synchronous (from withinonSubscribe(Disposable)itself) and asynchronous manner.voidNotifies theSingleObserverwith a single item and that theSinglehas finished sending push-based notifications.
-
Field Details
-
downstream
-
upstream
Disposable upstream
-
-
Constructor Details
-
MaterializeSingleObserver
-
-
Method Details
-
onSubscribe
Description copied from interface:SingleObserverProvides theSingleObserverwith the means of cancelling (disposing) the connection (channel) with the Single in both synchronous (from withinonSubscribe(Disposable)itself) and asynchronous manner.- Specified by:
onSubscribein interfaceCompletableObserver- Specified by:
onSubscribein interfaceMaybeObserver<T>- Specified by:
onSubscribein interfaceSingleObserver<T>- Parameters:
d- the Disposable instance whoseDisposable.dispose()can be called anytime to cancel the connection
-
onComplete
public void onComplete()Description copied from interface:MaybeObserverCalled once the deferred computation completes normally.- Specified by:
onCompletein interfaceCompletableObserver- Specified by:
onCompletein interfaceMaybeObserver<T>
-
onSuccess
Description copied from interface:SingleObserverNotifies theSingleObserverwith a single item and that theSinglehas finished sending push-based notifications.The
Singlewill not call this method if it callsSingleObserver.onError(Throwable).- Specified by:
onSuccessin interfaceMaybeObserver<T>- Specified by:
onSuccessin interfaceSingleObserver<T>- Parameters:
t- the item emitted by theSingle
-
onError
Description copied from interface:SingleObserverNotifies theSingleObserverthat theSinglehas experienced an error condition.If the
Singlecalls this method, it will not thereafter callSingleObserver.onSuccess(T).- Specified by:
onErrorin interfaceCompletableObserver- Specified by:
onErrorin interfaceMaybeObserver<T>- Specified by:
onErrorin interfaceSingleObserver<T>- Parameters:
e- the exception encountered by theSingle
-
isDisposed
public boolean isDisposed()Description copied from interface:DisposableReturns true if this resource has been disposed.- Specified by:
isDisposedin interfaceDisposable- Returns:
- true if this resource has been disposed
-
dispose
public void dispose()Description copied from interface:DisposableDispose the resource, the operation should be idempotent.- Specified by:
disposein interfaceDisposable
-