Package io.reactivex.rxjava3.subjects
Classes representing so-called hot sources, aka subjects, that implement a base reactive class and
the respective consumer type at once to allow forms of multicasting events to multiple
consumers as well as consuming another base reactive type of their kind.
Available subject classes with their respective base classes and consumer interfaces:
| Subject type | Base class | Consumer interface |
Subject
AsyncSubject
BehaviorSubject
PublishSubject
ReplaySubject
UnicastSubject
|
Observable |
Observer |
SingleSubject |
Single |
SingleObserver |
MaybeSubject |
Maybe |
MaybeObserver |
CompletableSubject |
Completable |
CompletableObserver |
The backpressure-aware variants of the Subject class are called
Processors and reside in the io.reactivex.processors package.
- See Also:
io.reactivex.rxjava3.processors
-
Interface Summary Interface Description ReplaySubject.ReplayBuffer<T> Abstraction over a buffer that receives events and replays them to individual Observers. -
Class Summary Class Description AsyncSubject<T> A Subject that emits the very last value followed by a completion event or the received error to Observers.AsyncSubject.AsyncDisposable<T> BehaviorSubject<T> Subject that emits the most recent item it has observed and all subsequent observed items to each subscribedObserver.BehaviorSubject.BehaviorDisposable<T> CompletableSubject Represents a hot Completable-like source and consumer of events similar to Subjects.CompletableSubject.CompletableDisposable MaybeSubject<T> Represents a hot Maybe-like source and consumer of events similar to Subjects.MaybeSubject.MaybeDisposable<T> PublishSubject<T> A Subject that emits (multicasts) items to currently subscribedObservers and terminal events to current or lateObservers.PublishSubject.PublishDisposable<T> Wraps the actual subscriber, tracks its requests and makes cancellation to remove itself from the current subscribers array.ReplaySubject<T> Replays events (in a configurable bounded or unbounded manner) to current and lateObservers.ReplaySubject.Node<T> ReplaySubject.ReplayDisposable<T> ReplaySubject.SizeAndTimeBoundReplayBuffer<T> ReplaySubject.SizeBoundReplayBuffer<T> ReplaySubject.TimedNode<T> ReplaySubject.UnboundedReplayBuffer<T> SerializedSubject<T> Serializes calls to the Observer methods.SingleSubject<T> Represents a hot Single-like source and consumer of events similar to Subjects.SingleSubject.SingleDisposable<T> Subject<T> Represents anObserverand anObservableat the same time, allowing multicasting events from a single source to multiple childObservers.UnicastSubject<T> A Subject that queues up events until a singleObserversubscribes to it, replays those events to it until theObservercatches up and then switches to relaying events live to this singleObserveruntil thisUnicastSubjectterminates or theObserverdisposes.