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
org.s and reside in the io.reactivex.processors package.
io.reactivex.rxjava3.processors
| Modifier and Type | Class and Description |
|---|---|
| public class | AsyncSubject<
the value type T>A Subject that emits the very last value followed by a completion event or the received error to Observers. |
| public class | BehaviorSubject<
the type of item expected to be observed by the Subject T>Subject that emits the most recent item it has observed and all subsequent observed items to each subscribed
|
| public class | CompletableSubject
Represents a hot Completable-like source and consumer of events similar to Subjects. |
| public class | MaybeSubject<
the value type received and emitted T>Represents a hot Maybe-like source and consumer of events similar to Subjects. |
| public class | PublishSubject<
the type of items observed and emitted by the Subject T>A Subject that emits (multicasts) items to currently subscribed |
| public class | ReplaySubject<
the value type T>Replays events (in a configurable bounded or unbounded manner) to current and late |
| pack-priv class | |
| public class | SingleSubject<
the value type received and emitted T>Represents a hot Single-like source and consumer of events similar to Subjects. |
| public abstract class | Subject<
the item value type T>Represents an |
| public class | UnicastSubject<
the value type received and emitted by this Subject subclass T>A Subject that queues up events until a single |