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 Details

  • Method Details

    • onSuccess

      public void onSuccess(T t)
      Description copied from interface: SingleObserver
      Notifies the SingleObserver with a single item and that the Single has finished sending push-based notifications.

      The Single will not call this method if it calls SingleObserver.onError(Throwable).

      Specified by:
      onSuccess in interface MaybeObserver<T>
      Specified by:
      onSuccess in interface SingleObserver<T>
      Parameters:
      t - the item emitted by the Single
    • onError

      public final void onError(Throwable t)
    • onComplete

      public final void onComplete()
    • dispose

      public final void dispose()
      Description copied from interface: Disposable
      Dispose the resource, the operation should be idempotent.
      Specified by:
      dispose in interface Disposable
    • isDisposed

      public final boolean isDisposed()
      Description copied from interface: Disposable
      Returns true if this resource has been disposed.
      Specified by:
      isDisposed in interface Disposable
      Returns:
      true if this resource has been disposed
    • onSubscribe

      public final void onSubscribe(Disposable d)
    • hasCustomOnError

      public final boolean hasCustomOnError()
      Description copied from interface: LambdaConsumerIntrospection
      Returns true or false if a custom onError consumer has been provided.
      Specified by:
      hasCustomOnError in interface LambdaConsumerIntrospection
      Returns:
      true if a custom onError consumer implementation was supplied. Returns false if the implementation is missing an error consumer and thus using a throwing default implementation.