Package io.reactivex.rxjava4.observers
package io.reactivex.rxjava4.observers
Default wrappers and implementations for observer-based consumer classes and interfaces,
including disposable and resource-tracking variants and
the
TestObserver that allows unit testing
Observable-, Single-,
Maybe- and Completable-based flows.
Available observer variants
| Reactive type | Base interface | Simple | Disposable | Resource |
Observable |
Observer |
DefaultObserver |
DisposableObserver |
DisposableObserver |
Maybe |
MaybeObserver |
N/A | DisposableMaybeObserver |
DisposableMaybeObserver |
Single |
SingleObserver |
N/A | DisposableSingleObserver |
DisposableSingleObserver |
Completable |
CompletableObserver |
N/A | DisposableCompletableObserver |
DisposableCompletableObserver |
-
ClassDescriptionBase class with shared infrastructure to support
TestSubscriberandTestObserver.Abstract base implementation of anObserverwith support for cancelling a subscription viaDefaultObserver.cancel()(synchronously) and callsDefaultObserver.onStart()when the subscription happens.An abstractCompletableObserverthat allows asynchronous cancellation by implementing Disposable.An abstractMaybeObserverthat allows asynchronous cancellation by implementingDisposable.An abstractObserverthat allows asynchronous cancellation by implementingDisposable.An abstractSingleObserverthat allows asynchronous cancellation by implementingDisposable.An interface that indicates that the implementing type is composed of individual components and exposes information about their behavior.An abstractCompletableObserverthat allows asynchronous cancellation of its subscription and associated resources.An abstractMaybeObserverthat allows asynchronous cancellation of its subscription and associated resources.An abstractObserverthat allows asynchronous cancellation of its subscription and associated resources.An abstractSingleObserverthat allows asynchronous cancellation of its subscription and the associated resources.SafeObserver<T>Wraps anotherObserverand ensures allonXXXmethods conform the protocol (except the requirement for serialized access).Serializes access to theObserver.onNext(Object),Observer.onError(Throwable)andObserver.onComplete()methods of anotherObserver.TestObserver<T>AnObserver,MaybeObserver,SingleObserverandCompletableObservercomposite that can record events fromObservables,Maybes,Singles andCompletables and allows making assertions about them.