Subjects are Observable and Subscriber hybrids since they both receive and emit events. There are five Subjects available in RxJava 2.0:
AsyncSubject
: Emits only the last value emitted by the source Observable followed by a completionBehaviorSubject
: Emits the most recent emitted value and then any value emitted by the source ObservablePublishSubject
: Emits to a subscriber only those items that are emitted by the source after the time of the subscriptionReplaySubject
: Emits to any subscriber all of the items that were emitted by the source, even if there is no subscriptionUnicastSubject
: Allows only a single Subscriber to subscribe to it during its lifetime