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 completion
- BehaviorSubject: Emits the most recent emitted value and then any value emitted by the source Observable
- PublishSubject: Emits to a subscriber only those items that are emitted by the source after the time of the subscription
- ReplaySubject: Emits to any subscriber all of the items that were emitted by the source, even if there is no subscription
- UnicastSubject: Allows only a single Subscriber to subscribe to it during its lifetime