
- RxJava Tutorial
- RxJava - Home
- RxJava - Overview
- RxJava - Environment Setup
- Observables
- RxJava - How Observable works
- RxJava - Creating Observables
- RxJava - Single Observable
- RxJava - MayBe Observable
- RxJava - Completable Observable
- RxJava - Using CompositeDisposable
- Operators
- RxJava - Creating Operators
- RxJava - Transforming Operators
- RxJava - Filtering Operators
- RxJava - Combining Operators
- RxJava - Utility Operators
- RxJava - Conditional Operators
- RxJava - Mathematical Operators
- RxJava - Connectable Operators
- Subjects
- RxJava - Subjects
- RxJava - PublishSubject
- RxJava - BehaviorSubject
- RxJava - ReplaySubject
- RxJava - AsyncSubject
- Schedulers
- RxJava - Schedulers
- RxJava - Trampoline Scheduler
- RxJava - NewThread Scheduler
- RxJava - Computation Scheduler
- RxJava - IO Scheduler
- RxJava - From Scheduler
- Miscellaneous
- RxJava - Buffering
- RxJava - Windowing
- RxJava Useful Resources
- RxJava - Quick Guide
- RxJava - Useful Resources
- RxJava - Discussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
RxJava - Subjects
As per the Reactive, a Subject can act as both Observable as well as Observer.
A Subject is a sort of bridge or proxy that is available in some implementations of ReactiveX that acts both as an observer and as an Observable. Because it is an observer, it can subscribe to one or more Observables, and because it is an Observable, it can pass through the items it observes by reemitting them, and it can also emit new items.
There are four types of Subjects −
Sr.No. | Subject & Description |
---|---|
1 | Publish Subject Emits only those items which are emitted after time of subscription. |
2 |
Replay Subject
Emits all the items emitted by source Observable regardless of when it has subscribed the Observable. |
3 | Behavior Subject Upon subscription, emits the most recent item then continue to emit item emitted by the source Observable. |
4 | Async Subject Emits the last item emitted by the source Observable after it's completes emission. |
Advertisements