Class DisposableAutoReleaseMultiObserver<T>
java.lang.Object
java.util.concurrent.atomic.AtomicReference<Disposable>
io.reactivex.rxjava3.internal.observers.DisposableAutoReleaseMultiObserver<T>
- Type Parameters:
T- the element type consumed
- All Implemented Interfaces:
CompletableObserver, MaybeObserver<T>, SingleObserver<T>, Disposable, LambdaConsumerIntrospection, Serializable
public final class DisposableAutoReleaseMultiObserver<T>
extends AtomicReference<Disposable>
implements SingleObserver<T>, MaybeObserver<T>, CompletableObserver
Wraps lambda callbacks and when the upstream terminates or this (Single | Maybe | Completable)
observer gets disposed, removes itself from a
CompositeDisposable.
History: 0.18.0 @ RxJavaExtensions
- Since:
- 3.1.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDisposableAutoReleaseMultiObserver(DisposableContainer composite, Consumer<? super T> onSuccess, Consumer<? super Throwable> onError, Action onComplete) -
Method Summary
Modifier and TypeMethodDescriptionfinal voiddispose()Dispose the resource, the operation should be idempotent.final booleanReturnstrueorfalseif a customonErrorconsumer has been provided.final booleanReturns true if this resource has been disposed.final voidfinal voidfinal voidvoidNotifies theSingleObserverwith a single item and that theSinglehas finished sending push-based notifications.Methods inherited from class AtomicReference
accumulateAndGet, compareAndExchange, compareAndExchangeAcquire, compareAndExchangeRelease, compareAndSet, get, getAcquire, getAndAccumulate, getAndSet, getAndUpdate, getOpaque, getPlain, lazySet, set, setOpaque, setPlain, setRelease, toString, updateAndGet, weakCompareAndSet, weakCompareAndSetAcquire, weakCompareAndSetPlain, weakCompareAndSetRelease, weakCompareAndSetVolatileMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface CompletableObserver
onComplete, onError, onSubscribeMethods inherited from interface MaybeObserver
onComplete, onError, onSubscribeMethods inherited from interface SingleObserver
onError, onSubscribe
-
Constructor Details
-
DisposableAutoReleaseMultiObserver
-
-
Method Details
-
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
-
onComplete
public final void onComplete() -
dispose
public final void dispose()Description copied from interface:DisposableDispose the resource, the operation should be idempotent.- Specified by:
disposein interfaceDisposable
-
isDisposed
public final 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
-
onSubscribe
-
hasCustomOnError
public final boolean hasCustomOnError()Description copied from interface:LambdaConsumerIntrospectionReturnstrueorfalseif a customonErrorconsumer has been provided.- Specified by:
hasCustomOnErrorin interfaceLambdaConsumerIntrospection- Returns:
trueif a customonErrorconsumer implementation was supplied. Returnsfalseif the implementation is missing an error consumer and thus using a throwing default implementation.
-